A bar in bar chart stacks one bar chart on top of the other. Typically the two bars will have different colors and widths. Bar in bar charts can be effective in showing progress to a goal, or any two measures from the same starting point. In this recipe, we will compare the field goals made and attempted by the Phoenix Suns players in 2009 using a bar in bar chart.
To follow this recipe, open B05527_02 – STARTER.twbx
. Use the worksheet called Bar in Bar
, and connect to the Player Stats (NBA Players Regular Season 2009)
data source.
The following are the steps to create a bar in bar chart:
In this recipe, we started by creating a bar chart. A simple bar chart will typically have a dimension in either Rows or Columns, and a measure on the other shelf. Here we started with the Player Name dimension on Rows, and the Field Goals Made measure on Columns. When you drag another measure to the axis initially created by the measure, the original measure in the shelf gets replaced with Measure Values. This means that there are now multiple measures that are sharing the same axis.
By default when we have a shared axis chart, the bars are stacked on top of each other. The total length of the bar is cumulative total of both bars. This is great if we only care about the cumulative total. However, if you want to compare the two bars, it becomes tricky because the bars don't both start at the same starting point. The bar in bar chart can help in this case.
To create a bar in bar, we can start with the stacked bar chart, and then unstack the bars so instead of having the bars on top of each other, the bars now will start at the same point (which is zero). In Tableau, this can be done by going to the Analysis menu, and under Stack Marks, checking Off.
When we first unstack the bar, one bar may completely mask another bar, which still makes comparing the bars difficult. A key technique here is to differentiate the bars by color and by size—this makes the bars easier to compare.
18.220.152.139