Charts / React basic charts / Time series
Stacked area
How a total is made up over time, switchable between real amounts and each layer’s share of 100%.
React component StackedArea, data through props. One or more measures over a continuous run of time. Tags: area, stacked, composition, time series, 100%, share, cumulative.
Install
npm i klar-charts
import 'klar-charts/styles.css'
import { ThemeScope, StackedArea } from 'klar-charts'
# or copy the source:
npx shadcn@latest add https://klar.run/r/basic-stacked-area.json
Usage
<StackedArea x={months18} series={cloudSpend} mode={m as 'absolute' | 'percent'} unit="currency" height={372} dateFormat={{ month: 'short', year: 'numeric' }} ariaLabel="Monthly cloud spend by service over 18 months" />
Related stacked area charts
- Token streamgraph: Tokens per model family over 24 hours, stacked around a wiggle baseline, with a scrubber readout.
- Latency percentile fan: The p50 line inside nested p75, p90 and p99 bands, against the SLO and an incident window.
- AreaChart: Lines with optional area fill, dashed comparison series, markers and a hover readout; here a sprint burndown.
- Latency heatmap: Six hours of requests bucketed by response time, with deploy markers and an incident band.
- Dot-matrix progress: Daily revenue as columns of cells, the influenced share in a second hue, against a dashed daily goal.
- DotMatrix: Values as stacked dots, one column per period, with a highlighted range; here thirty days of revenue.