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.

The hero chart above stacks three sales channels for six states. Read the tops of the columns first: New South Wales is the largest market and Tasmania the smallest, and the ranking runs left to right because the states were sorted by total. Then read the blue segments, which all stand on the baseline: direct sales can be compared state to state with the same accuracy as any bar chart. Now try to compare the orange partner segments between Queensland and Western Australia. Each starts at a different height, and the eye has to subtract — which is the compromise every stacked bar makes. Randomise the data: however the numbers fall, the blue segments stay comparable and the orange ones never do.

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

Standard or 100%: decide which question you are answering

The pair below holds the same six states. The first keeps the totals; the second divides every state's channels by its own total so that each column is exactly one hundred percent.

Standard stacked: totals first, mix second
Column height is revenue; the reader sees that New South Wales is four times Tasmania before noticing anything about channels. The mix is readable only roughly, because each state's column is a different height.
100% stacked: mix only, totals discarded
Every column is the same height, so the channel shares line up and can be compared directly: Tasmania and Queensland lean furthest towards online, Western Australia towards partners. The price is that nothing here says which state is big.

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. The two figures below stack the same twelve months two ways.

Volatile series on the baseline
Campaign spend swings from month to month, and because it sits at the bottom every segment above it inherits the swing. The steady retainer income looks jagged when it is not; the reader cannot tell which series is actually moving.
Stable series on the baseline
The same months with the retainers at the bottom and campaigns on top. Now the retainer's slow growth is a clean staircase, licensing is a steady band, and every jagged edge belongs to the campaigns — which is the truth of the data.

Group when the segments must be compared

The stack's weakness is fixed, not stylistic: no arrangement of colours puts the upper segments on a common baseline. When the reader's question is about one channel across states rather than each state's total, unstack.

The hero data, grouped
Each channel now stands on the baseline in every state. Partner revenue in Queensland against Western Australia is a straight length comparison. What has been lost is the state total, which the reader would have to add up by eye.

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.

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

The composition of a stacked bar chart
An anatomical guide

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.

  • Grouped bar — for comparison between series within groups. Different question.
  • 100% stacked bar — normalised to show composition only. Treat as its own form.
  • Waterfall — the right form when some of the components are negative.
  • 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.