Creating stacked bar graphs

In stacked bar graphs, various categories of the same field are plotted on top of each other. One of the biggest problems with the stacked bar graphs is that the length of the bars is hard to measure, except for the bottom bar in the stack. Some people argue that it is good at showing the proportion or comparison of two or more categories; however, if comparison is the objective, there are much better alternatives, such as facets and small multiples, which have higher efficacy in comparing data. If you must use a stacked bar graph, limit the number of stacks to two to three categories and avoid very disproportionate stacks, such as 99 percent and 1 percent stacks.

Getting ready

Let's use the sample file, Sample – Superstore Sales (Excel). Open a new worksheet and select Sample – Superstore Sales (Excel) as the data source.

How to do it...

Once the data is loaded, perform the following steps to create a simple, one-variable stacked bar graph:

  1. Drag-and-drop Profit from Measures into the Rows shelf.
  2. Drag-and-drop Category under Products from Dimensions into the Color box from the Marks pane.
  3. Change the Marks type to Automatic. The resulting graph is shown in the following screenshot:
    How to do it...

How it works...

Since we use Color to encode the Category variable, Tableau automatically assigns the default colors to various Category types and, in effect, produces the stacked bar graph. You could also select Category from Dimensions and Profit from Measures and click on the stacked bars graph button on the Show Me toolbar to create the same graph. As you can see from the graph, the reader has to look at the legend colors to distinguish various Category types, thus increasing the difficulty in understanding the information presented. An alternative to this type of chart is creating multiple charts or facets. To create such facets, in this recipe, we can drag-and-drop Category into the Rows shelf before Profit.

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

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