Creating a Stacked Bar chart

A Stacked Bar chart is an extension of the bar chart where we use colors to represent additional information. These are typically used when we are trying to show a comparison within a particular category as well as across categories.

So, for example, in the previous recipe where we created a bar chart showing Sales across Region, we would additionally want to look at the performance of various product categories within a particular region and compare their performance across regions. To understand this, we will create a Stacked Bar chart.

How to do it…

  1. Let us duplicate the Bar chart sheet by right-clicking on the sheet tab of Bar chart and then selecting the Duplicate Sheet option. Refer to the following image:
    How to do it…
  2. We will then rename the new sheet to Stacked bar chart.
  3. Next, we will drag Category from the Dimensions pane and drop it into the Color shelf in the Marks card. Refer to the following image:
    How to do it…

How it works…

In the earlier bar chart, the Sales across Region bar chart, we showed the total number of sales across different regions. The taller or longer the bar, the greater the sales. However, when we drop Category into the Color shelf, we break the total sales for that region into three parts. These parts are shown with different colors, and the color legend helps us identify the exact product category. Thus, we get to see how each category is performing when compared to other categories in terms of sales within a particular region, and we can also compare the Sales of these product Categories across Regions.

For example, in the preceding chart, if we look at just the bar for the East region, we get to see that the red block that represents Technology is taller as compared to the blue and orange blocks that represent Furniture and Office Supplies, respectively. This indicates that Technology has more sales as against Furniture and Office Supplies in the East region.

Further, if we now look at the entire view instead of just focusing on one region, we can see how the performance of Technology has been across all the regions. Thus, we have the ability to compare product Categories within a Region and also across different Regions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.111.87