This is a guest post from Fabio Murgia, a data visualization designer with the iDeas Lab at the Center for Strategic and International Studies (CSIS), where he specializes in translating data sets into infographics and visual stories. Before joining CSIS, Fabio worked as a multimedia designer at New America, a think tank, and has always been passionate about the fundamental ways numbers affect public policy–and how public policy, in turn, affects our lives.
What Makes the Difference in a Stacked Bar Chart?
I was intrigued by Jon’s recent post about improving the design of stacked bar charts. They are a stronghold of popular data visualization, well-established in virtually every presentation, report, analysis, and dashboard. But despite their simplicity, stacked bar charts are demanding: they ask readers to compare values from both a shared baseline as well as separate, shifting baselines–all while interpreting part-to-whole relationships.
I’ll borrow the same example from Jon’s article, stacking a sample dataset on Revenue by Segment for the West, East, Central, and South regions.
The shifting baselines of Corporate and Home Office make the region’s comparison harder than the Consumer segment. Un-stacking the bars into multiple bar charts with segment-relevant baselines solves the problem, but at the expense of losing representation of the totals.
With segment-relevant baselines, we create three separate charts and align them vertically, while the spacing between baselines is a matter of margins and is not data-relevant. But what if we stacked the charts up to the highest value?
This operation (mathematically equivalent to subtracting each value from the highest group in each category) generates value deficits from benchmark entry. In doing so we obtain data-driven gaps.
The deficit gaps exist in virtue of the reference value being the highest total—I call it AlphaR for simplicity—and I’m going to extend the gridlines rightward to distinguish the two views: borrowing from the photography world, I’ll call them the “Negative view” (top-to-bottom) on the right, and the “Positive view” (bottom-to-top) on the left. I’ll go ahead and style it a bit, too.
The negative view shows something not directly present in the data, but derived from it.
By establishing a benchmark value—through clear styling, a title, or a symbol—the focus shifts to visualizing difference. An ordered bar chart that follows the natural reading direction (highest to lowest from left to right) already cues the reader that the leftmost bar is the largest. The insight, then, comes from seeing how much the others fall short—which is what this configuration directly represents.
The Totals
The deficit gaps uncover insights that were previously subtle or invisible, often overshadowed by the dominant, highest group. However, we are still missing on representing the totals. If it’s clear that AlphaR is the protagonist of our chart, we could apply the same principle and use it as a reference for all other entries’ totals. Switching back to the “positive” view, a minimal solution could be adding “shadow” of the totals as markers on the AlphaR bar.
An alternative could be creating a close-up grouping of the entries’ total against the AlphaR value, while keeping the single-baselines configuration on the other side. A two-side configuration can go as far as representing a stacked version on one side, and a segment-relevant baselines on the other, with an AlphaR reference bar in the middle.
What if the segments are proportionally inconsistent across groups?
This approach, however, only works if the parts maintain a somewhat consistent proportion across groups—meaning that the AlphaR has the highest total and the highest categorical value for each group. That might not always be the case, so I took the liberty to imagine such a scenario and add a Sponsor category, just to test the design with more complexity.
Being the highest total, AlphaR takes the leftmost spot, but in this example East has the highest Corporate value. Using the multi-baseline version from the benchmark stack wouldn’t work unless those higher values are shifted away from the bar alignment.
In doing so, we are presented with the opportunity to deduce the difference from the benchmark segment—a surplus, in this case.
To visualize the surplus the baseline reads bottom-to-top again, so I moved the labels on top of the baselines grids.
Switching to the negative view, the surplus for the East and Central Corporate segments exist alongside the deficit of all other segments in relation to AlphaR. No deficit for East and Central Corporate segments, while—it’s easy to notice—it’s barely there for the South.
The two views tell two sides of the same story: a maximum, benchmark value as the reference for measuring the difference with all the other entries. But a “high value” is such only when compared to something else not as high, which makes all the not-as-high entries the necessary counterpart of an ordered bar chart.
As previously mentioned, this configuration relies on AlphaR being established as the reference value, effectively losing its status of “regular group” in favor of becoming the chart’s scale. Using an effective title and deliberate hierarchy design might help the reader approach the chart already knowing that AlphaR is the highest-scoring value, so that they can focus on all the ways the other entries are different from the top value.
At this point, I might have wondered too far from Jon’s original question. My attempt to improve the stacked bar chart focused on one key shortcoming for the reader experience, i.e. the segment comparison across varying baselines, but my thought process was driven by the search for the most informative design: what am I really representing? What should the reader see? What matters most in the data?
The AlphaR-centric configuration served as a vehicle for Jon dataviz theory rather than a serious contender for improving the stacked bar chart. As Jon noted, “people know how to read the stacked bar chart”; and what people know is ultimately the key variable to design information in the most intuitive and accessible way.