Stacked area chart
Parts of a whole over time, stacked from the baseline. Switching between values and share morphs the same layers, so growth and share read as one picture.
| Period | Starter | Team | Enterprise | Total |
|---|---|---|---|---|
| Jan | 18 | 24 | 30 | 72 |
| Feb | 20.2 | 27.1 | 30.55 | 77.85 |
| Mar | 22.4 | 30.2 | 32.2 | 84.8 |
| Apr | 21.6 | 33.3 | 34.95 | 89.85 |
| May | 23.8 | 36.4 | 38.8 | 99 |
| Jun | 26 | 39.5 | 43.75 | 109.25 |
| Jul | 25.2 | 42.6 | 49.8 | 117.6 |
| Aug | 27.4 | 45.7 | 56.95 | 130.05 |
| Sep | 29.6 | 48.8 | 65.2 | 143.60000000000002 |
| Oct | 28.799999999999997 | 51.900000000000006 | 74.55000000000001 | 155.25 |
| Nov | 31 | 55 | 85 | 171 |
| Dec | 33.2 | 58.1 | 96.55000000000001 | 187.85000000000002 |
When to use
- Revenue by plan, traffic by source or spend by team across months.
- Questions about both size and mix.
When not to use
- Series that do not add up to a total; use the line chart.
- More than five or six layers; the middle ones become unreadable.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/stacked-area-chart
Adds its 8 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
StackedAreaChart
10 props
PropTypeDefault
label *string—
data *readonly ChartDatum[]—
series *readonly ChartSeries[]—
unitstring""
mode"values" | "share""values"
heightnumber260
formatValue((value: number) => string)numberText
loadingboolean—
errorstring—
classNamestring—
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group and status semantics, with aria-label, aria-busy and aria-hidden kept in step with state. Changes that matter are announced through a live region.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/stacked-area-chart.mdThe index of every part is at /llms.txt.