Analyzing a Stacked Bar Chart
Below you will see a stacked column (vertical bars) chart that has nine different segments covering eight months. I have absolutely nothing against HubSpot and actually think they have some great services, tools and products. I am simply using their chart to illustrate the problems with stacked bar charts and some alternatives.
I can think of a few reasons off the top of my head as to why people would use stacked bar charts.
- To show how each segment changes over time
- To illustrate parts of the whole at any given time
- A combination of 1 and 2 above
The problem is that a stacked column chart is not good for either of these requirements. My feelings on these charts is not really anything new, as I’ve stated before on this post and also this post. In my opinion, after you get beyond two series with like scales, a stacked column chart is pretty and pretty useless.
So what are the alternatives? The answer is a very common one, it depends. Is the goal to show parts of the whole or is it to show a trend? I think there isn’t really an optimal chart that shows both as well as a specific one for each. Do I dare suggest that a pie chart would be an improvement at showing the parts of the whole for each period? The alternatives below do not use the same data set and are just made up.
The first Alternative below uses Tableau Public to show each segment as a separate column chart. This does a better job at showing the parts of the whole and trend of each segment. By using the interactive version, which isn’t really fair when compared to the image above, it also allows the reader to see values on the hover. I do like Tableau for creating these trellis type charts quickly and easily. I did find a bit of trouble navigating Tableau and couldn’t seem to get rid of the “number of records” series that shows up in my version after Feb 10. Regardless, I think you get the point that this may be a better alternative.
The next alternative below is a line graph with multiple segments and one for the total of all the segments. The total line would show what the total height of a stacked column would show. This is a better way to show the trend over time, but it’s very difficult to make out the lines that fall below the 100 value on the y-axis. Also, you can’t really tell how each of the parts make up the whole using this method. I typically label each line instead of using a legend, but that wouldn’t work here because of the tight cluster at the bottom of the chart.
Another option would be to use a dynamic line graph that has a slider feature to quickly change between the segments. With this feature you could click the up/down arrow to scroll through the data series. This makes it quite easy to see each segment, but doesn’t allow you to compare one to the others.
The chart below is another alternative where the overlap option is set to “separated” for the stacked column chart. I think this is a pretty good option because it’s much easier to see the parts of the whole and also the trend to some extent. If you have more data series it could easily get unwieldy.
Finally, an alternative would be to use a panel chart (trellis display or small multiple) to show each month using the same axis. This example uses bar charts, which make the comparison between the segments stand out better. You could also use line graphs with the axis being the months and a separate panel for each segment. The line graph panel chart would be better at showing the trend, but would fall short on the comparison aspect.
Below is an example of the panel chart using line graphs that show the trends quite well. The downside would be the lack of comparing parts of the whole and also the small values do not show up well when the scale is the same for all charts.
In conclusion, I have scaled back my approach of never using a stacked column chart because when used correctly it can work as seen in the example where the segments are separated. Using a default formatted Excel Column chart is not a good option. If the true point of the data visualizations is to illustrate either parts of the whole or trend, then a panel display using bars or lines would be a better option. Another option is to use a software package like Tableau.
What method would you use to show this data?



March 8th, 2010 at 8:02 am
The line chart (“stacked column chart 4″) is my first choice, but you should put “Total” first in the legend. Better yet, label the lines themselves.
A companion line chart comparing percentage of the whole vs time instead of value vs time could be insightful.
The offset stacked column chart might be my second choice. It is arguably more effective than the aligned stacked column, but it is still a trick to compare the bars that have different baselines. It is also possible that the tops of the individual bars in each stack unintentionally imply more of a trend than intended. This is shown in Stephen Few’s article Boxes of Insight. The bar chart looks like a steadily increasing trend, because the eye combines the female and male data without contrasting them. The box plot below it reverses the F/M order, and boxes each pair within salary ranges, and the F/M difference is glaringly obvious.
The first panel you show (“reach chart”) and the last (“trend”) are less effective than panel charts can be, since the different series have such different values.
March 8th, 2010 at 9:03 am
I’m a great believer in lagniappe: putting in a little extra that isn’t required by the primary mission, provided first that it does no harm.
So I’d happily use a stacked bar chart when the requirement was for an unstacked total bar, because that’s something the stacked bar is very good at: showing changes in the total.
But I’m with you about stacked bars when the primary mission is comparing the individual parts. They just don’t do that job very well.
March 8th, 2010 at 11:11 am
Another interesting view would be percent difference from previous.
With your sample data, it shows that you did a 25% increase each month in each area, but with real data the view would be more interesting.
March 15th, 2010 at 2:40 am
[...] too. Debra shares a little tip on how to do this. Read more about this on Contextures website. Why stacked bar charts are not such a good ideaTony from Support Analytics dissects a stacked column chart and tells us why stacking may not be a [...]
March 15th, 2010 at 11:46 am
I agree with that a stacked column chart is not a good idea for the above data and I highly commend the proposed alternatives. However, I would caution not to conclude that a stacked column chart is no use in general. It is not very helpful with the above example because such a plain stacked column chart wouldn’t clearly display the trend of each segment over time.
However, a stacked column can be useful for another set of data. For example, I work in a hospital that has multiple units and I have to present the number of patients by unit and by their status. So far, a stacked column is the best way to show this data at a glance because people can compare the total number of patients among units and the composition (status) of each unit data at the same time. I also often show the value on each bar or with a data table (to avoid a busy look) and people find this very helpful.
March 15th, 2010 at 3:42 pm
Jon, I prefer to label the lines themselves. But in this case, the lines at the bottom are too clustered to make this a feasible option.
I need to know your secret for keeping track of these articles. You have a knack for pulling them out at the precise time.
Thanks for the comments!
March 15th, 2010 at 3:45 pm
Derek, if the primary goal was to show the changes in the total, a single line graph would have been a good choice. I prefer a line over a column when time is on the x-axis. Thank you for your comment!
March 15th, 2010 at 3:48 pm
Joe, you are absolutely right. I did use a generic 25% increase for each segment for each month because I didn’t have access to the original data. I agree that showing the percent change from month to month is a good idea, but the real question is what style chart do you use? Thanks for the comment!
March 15th, 2010 at 3:56 pm
WKim, I would love to get a look at your chart? I think I would agree with your approach, but by having the visual, I would be able to confirm or recommend a different visualization. Would you be able to change or remove any proprietary information and send it to me? Thanks for the information and comment!
March 15th, 2010 at 4:35 pm
Since it is a time series, I would go with a line chart. Something like: http://public.tableausoftware.com/views/Reach/ReachDashboard
(I made up my own data, so there are some interesting stories to be seen. I also used a different structure of my data source, so it is easier to make charts like these in Tableau.)
March 15th, 2010 at 8:48 pm
My system is not perfect. I often sit down to write an article, go to Google to get some info, then find the same article I had written months before.
March 15th, 2010 at 8:50 pm
These are good. A series of line charts showing a whole array of quantities.
March 15th, 2010 at 9:50 pm
That’s too funny.
March 15th, 2010 at 10:04 pm
I agree – these are good. I like that I can see all four graphs on my screen as well as seeing both the percentage from the first and from the previous. Both are good views into the data. What I also like a lot is that even though it’s hard to label the lines, in Tableau you can click on one of the reach methods and it is highlighted in all of the charts. Even further, if I hold down ctrl and hit multiple methods, they are each highlighted.
Maybe a slight improvement would be to abbrev. the labels on the x-axis and decrease the size of the four charts.
Though your version takes up more real estate then the HubSpot one, it turns a very bad chart into insights that mean something valuable. Nice job Joe and thanks again for sharing!
March 16th, 2010 at 12:58 pm
Since you are already using Tableau Public, you could use filters and reference lines so that you can control those pieces you want to analyze. If you only want to compare Twitter and Facebook, the rest is just white noise! A line chart comparing the two and filtering the rest would be easy to make. If you want the whole smash though, Joe Mako’s approach is not bad.