Vega-Lite Stacked Area

A multi-series stacked area chart where the cumulative top edge tells the total story and each band shows the sub-series contribution. Vega-Lite stacks `area` marks automatically when the data has a categorical `color` channel, so the spec is essentially identical to a single-ser

Template details

  • chart
  • area
  • stacked
  • composition
  • vega
  • vega-lite

When to use this template

A stacked area chart effectively illustrates how a total quantity changes over time, while simultaneously revealing the evolving composition of that total. Analysts use it to understand both the overall trend and the proportional contribution of different categories to the whole, making it easy to spot shifts in dominance or emerging components.

  • Time-series data with a continuous temporal axis.
  • Multiple distinct categorical series (e.g., product types, regions).
  • Quantitative values that are additive and represent parts of a whole.
  • Datasets where component contributions to the total are key.
  • Moderate number of series (typically 3-8) for readability.
  • Data where the absolute magnitude and relative proportions matter.

Browse all Koan templates