Stacked

Stacked charts pile series on top of each other, to show how parts add up to a total or share it.

LLMs

Usage

When stacking bars or areas is the right choice, when another chart reads better, and how to draw a stack that tells the truth. The same rules hold in every chart library. For picking between chart types in general, see Choosing a chart.

What it is for

A stacked chart shows a total and the parts it is made of. Each bar or area is split into segments, one per part, piled on top of each other, so the top edge is the total.

When to use

  • The total matters most and the parts explain it, such as revenue by channel per month.
  • The shares of a total change over time and the totals do not matter. Stack to 100%.
  • Answers fall on an ordered scale with a middle, such as a survey from disagree to agree. Center the stack on the middle answer.
  • Values go both above and below zero, such as income and costs. Stack the positive parts up and the negative parts down.

Use something else when

  • The reader must compare one part across categories, and it is not the bottom one. Use grouped bars, or one small chart per part, so every part starts from zero.
  • The series are not parts of one total. Adding them up means nothing. Use a line chart or grouped bars.
  • There are more than about five parts. Group the small ones as "Other", or use a table or a treemap.
  • You show the parts of one total at one moment. Use a single bar or a pie chart.
  • You show how a start value becomes an end value through gains and losses. Use a waterfall chart.

How it reads

The bottom segment and the total both start from the baseline, so the reader compares them as accurately as plain bars. Every segment in between floats on the ones below it. The reader has to judge its length or thickness without a shared start, which people do poorly. A 100% stack moves the shared edges to the bottom and the top, so the first and the last part read well and the middle ones do not.

Do it well

  • Put the part that matters most at the bottom, on the baseline.
  • Keep the same order of parts in every bar or point, and in the legend and the tooltip.
  • Order the parts by meaning when they have one, such as the answers on a survey scale, and by size when they do not.
  • Use related colors for an ordered scale, and distinct colors for parts that have no order. The Color guideline has the palettes.
  • Label the total at the top of each stack when the reader needs the number.
  • Start the value axis at zero. A stack is a sum from the baseline.

Pitfalls

  • Asking the reader to compare middle segments. Their bases move, so equal parts look different. Show those parts on their own.
  • A 100% stack where the totals differ a lot. A small month and a big month look the same. Show the totals next to it, or use plain stacks.
  • A part that changes order from one bar to the next. The reader loses track of it.
  • A streamgraph for exact values. Its center line moves, so no layer has a baseline. Use it for the overall shape only.
  • Negative values in a plain stack. Stack them below zero, not inside the positive segments.

Variants

  • Stacked bars: parts of a total for each category or period.
  • Stacked areas: parts of a total over a long time range.
  • 100% stacked: shares, every bar or point at full height.
  • Diverging: positive parts above zero and negative parts below, or an ordered scale centered on its middle answer.
  • Streamgraph: areas stacked around a moving center, for the shape of many series over time.
  • Marimekko: a 100% stack where each column's width is its share of the whole.

Compared with similar charts

  • Against grouped bars: grouped bars compare the parts with each other, stacked bars show the total. Pick by what the reader asks.
  • Against a line chart: lines show each series from its own baseline. Use them when the series are not parts of a total.
  • Against a pie chart: a pie shows the shares of one total. A 100% stack shows how the shares change across categories or time.
  • Against a treemap: a treemap fits many parts and nested parts, but only for one total.