Now, I want to show you what

happens when you are trying to represent additional information with these graphs.

In particular, if you have additional attributes and you want

to be able to introduce in the representation.

Let's start with the bar chart.

So, let's say that in a bar chart,

now you want to represent an information coming from an additional categorical attribute.

In this example that I have here,

I'm using once again the vehicle collision data,

and I'm representing in this case information about what kind of

vehicle is involved in the accident,

and what are the main causes for these accidents.

So, we have vehicle type,

main cause for the accident,

and for each combination of these two categories,

how many accidents or how many people injured we have.

So, how do we represent these information with a bar chart?

There are two main designs;

the stacked bar chart,

and the grouped bar chart.

In a stacked bar chart,

this information is represented as follows.

So, we have as many bars as

the number of categories that are included in the first categorical attribute

and as many segments within

each bar as the values that are in the other categorical attribute.

So, in this case for instance,

we have vehicle types represented

by the three bars that you see in the stacked bar chart,

and the main causes for collisions represented by the four colored,

sorry, the five colored categories, okay?

The five-colored main contributing factors for the collisions.

In the grouped bar chart,

we have exactly the same information but represented by a different configuration.

In this case we have that the same bar graph is

repeated multiple times for the number

of categories that exist for the other categorical attribute.

So, one categorical attribute is mapped to the bar chart and this bar chart is

repeated as many times as

the number of categories that you have in the other categorical attribute.

So, what are the advantages and disadvantages of these two graphs?

Well, the stacked bar graph is very good when

your main question is regarding the proportion.

So, if it's important for you to understand what is

the proportion of values within each category,

it's very good to communicate proportions,

sometimes this is also called part-to-whole information.

Whereas the grouped bar chart is better when

the goal is to compare every single value one to another.