Klar

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