What it is
A stacked area chart adds series on top of each other along a time axis. The outline of the whole shape shows the total, and the thickness of each band shows that part’s contribution at every moment.
✓ Use it when
- You want to show both the total and its composition over time: energy by source, revenue by product, population by region.
- There are several parts — up to six or seven — and many time points.
✗ Avoid it when
- You need to read exact values of the upper layers — they ride on the layers below and have no flat baseline.
- The parts include negative values.
- The total is meaningless because the series measure different things.
Tips for a better chart
- Put the steadiest series at the bottom and the most volatile at the top, so wiggles don’t propagate through every layer above them (Byron & Wattenberg 2008).
- Keep layer colours distinct but similar in weight; let one series stand out only if it is the story.
- If shares matter more than totals, normalise each time point to 100%.
The maths
At each time t, layer j spans from Sj−1(t) to Sj(t), where Sj(t) = Σm≤j ym(t). A band’s thickness is its value, but its apparent slope is the sum of its own change and every change beneath it — which is why the order of layers matters.
Byron and Wattenberg formalised this as minimising the “wiggle” of the layers and used it to design the streamgraph, a stacked area with a moving baseline (Byron & Wattenberg 2008).
A little history
Stacked areas descend from the divided time charts of early statistical handbooks (Brinton 1914). In 2008 the streamgraph, popularised by an interactive New York Times graphic of box-office takings, showed how far the form could be pushed; its geometry was published the same year (Byron & Wattenberg 2008).
Questions
Why does the top layer look so jagged?
Each layer inherits the ups and downs of every layer beneath it. Move the most variable series to the top.
References
- Byron, L. & Wattenberg, M. (2008). Stacked graphs — geometry & aesthetics. IEEE Transactions on Visualization and Computer Graphics 14(6), 1245–1252.
- Brinton, W. C. (1914). Graphic Methods for Presenting Facts. New York: The Engineering Magazine Company.
- Cleveland, W. S. & McGill, R. (1984). Graphical perception: theory, experimentation, and application to the development of graphical methods. Journal of the American Statistical Association 79(387), 531–554.