Skip to content
Chart Buffet All you can plot

Change over time

Stacked area chart maker

Layers stacked on top of each other over time: the top edge is the total and each band is one part of it.

1Your data

Your data never leaves this browser

Tip: copy cells straight from a spreadsheet and press Ctrl+V (⌘V on a Mac). · CSV, TSV, JSON, Excel or ODS

3Style it

Warming up the kitchen…
Data
Titles and text
Title alignment
Look
Look
Colours
Series colours
Marks and labels
Axes and numbers
Size
Download
Format
Resolution

2× is sharp on high-density screens and in print.

Keep a chart as a file to reopen or share later.

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

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

  1. Byron, L. & Wattenberg, M. (2008). Stacked graphs — geometry & aesthetics. IEEE Transactions on Visualization and Computer Graphics 14(6), 1245–1252.
  2. Brinton, W. C. (1914). Graphic Methods for Presenting Facts. New York: The Engineering Magazine Company.
  3. 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.