This entry is part of the Chart Index, the reference library for the Chart Design Field Guide.
The stacked bar takes the same data as a grouped bar and rearranges the question. Grouped asks: how do the series compare within each group? Stacked asks: how does the total compose? Each bar is partitioned into segments, each segment a series, and the eye reads the bar's total height as a sum.
There is a clean variant — the standard stacked bar — and a powerful one — the 100% stacked bar, where every bar is normalised to the same total height to reveal composition. They look similar, they read very differently, and both come with the well-known limitation: only the bottom segment sits on a shared baseline, so only the bottom is precisely comparable across bars.
What it is
A stacked bar chart maps a primary categorical variable to position along the x-axis and a secondary categorical variable to coloured segments stacked within each bar. The quantitative variable is encoded by segment length. The bar's total height is the sum of its segments, which becomes the secondary encoding.
Five regions, three sales channels. The total height shows which region is biggest (East); the segments show that the channel mix is roughly consistent. If the mix varied dramatically, that variation would be the story — and a 100% stacked form would tell it better.
When to use it
Stacked bars are the right choice when:
- The reader's primary question is "what is the total?" and the secondary question is "what makes it up?"
- You have 3–5 series per bar. More than five and the upper segments become hard to compare.
- The series compose a meaningful whole — channels of revenue, types of customer, components of cost.
- You have fewer than ~10 groups. Beyond that, the visual rhythm of stacked bars becomes hard to scan.
- The data is non-negative. Stacked bars with negative values require careful baseline handling and are usually better as a waterfall or grouped form.
When not to use it
- Precise comparison of non-bottom segments. A segment that sits at the top of the stack starts from a different baseline in every bar. The eye cannot accurately compare segments without a shared baseline.
- Many series per bar. Six or more segments produce a stack of indistinguishable colour bands. Use a grouped bar, dot plot, or small multiples.
- Negative values. Sales returns, refunds, or losses stacked alongside revenue create ambiguous bars that can extend below the baseline. Use a waterfall instead.
- Composition without meaningful totals. If the total is not interpretable (e.g. summing different units), stacking is misleading.
Design principles
Order series by stability
Place the least-variable series at the bottom (on the shared baseline) and the most-variable at the top. The bottom segment is the one the eye can compare precisely; reserve it for the series that does not change much, and let the visually-noisier series sit higher where the eye expects variability.
Use one colour family
Stacked segments share an axis of meaning — they are parts of the same whole. Use a single hue ramp (light to dark) or a desaturated categorical palette. Saturated rainbow palettes turn the stack into decoration.
Annotate totals when they matter
If the total height is the message, place the total above each bar. The reader does not have to mentally sum the segments. This is the stacked-bar equivalent of direct-labelling.
Use 100% stacked for composition comparison
When the question is how does the mix differ between groups?, normalise every bar to the same total height. Each bar becomes a part-to-whole display, and the segment proportions across bars become directly comparable. The trade-off: absolute totals are gone.
Direct-label segment values when the bar is large enough
For wide bars and large segments, place the value inside the segment in white type. Small segments cannot host labels; leave those blank or use a leader line.
Quiet the legend
A stacked bar needs to identify which colour is which series. For three series, label the first bar directly with leader lines instead of a separate legend. For more than four, a small legend at the top, with the series order matching the stack order from bottom to top, is the convention.
Avoid 3D stacking
3D stacked bars compound every distortion of 3D pies: front segments dominate, depth cues distort length, and the chart becomes ornamental. Refuse to ship them.
Anatomy
A stacked bar is structurally a bar chart with internal partitioning. The trade-off is permanent: the bottom segment is precisely comparable, the rest are approximately so. Design choices — series order, label placement, palette — work around this constraint.
Related types
- Grouped bar — for comparison between series within groups. Different question.
- 100% stacked bar — normalised to show composition only. Treat as its own form.
- Treemap — for compositional comparison with many categories and possible hierarchy.
- Marimekko / Mosaic — stacked bars with variable widths encoding a second quantity.
- Stream graph — stacked area over time, with a flowing baseline.
Reading list
- Few, S. (2012). Show Me the Numbers. On the limits of stacking and the case for grouped alternatives.
- Tufte, E. (2001). The Visual Display of Quantitative Information. Data-ink and stacked-bar variants.
- Heer, J. & Bostock, M. (2010). Crowdsourcing Graphical Perception. Empirical evidence on stacked-bar accuracy.