Back to Charts

Cartesian

AreaChart

Area chart for time, numeric, or categorical x-values. Supports basic fills, stepped curves, stacked totals, and 100% expanded comparisons.

Examples

Interactive

Area Chart - Interactive Showing total visitors for the last 6 weeks. Desktop 1,749 Mobile 1,351 Desktop Mobile
Area Chart - InteractiveShowing total visitors for the last 6 weeks.0100200300400Apr 1Apr 8Apr 15Apr 22Apr 29May 6
Area Chart - Interactive
dateDesktopMobile
Apr 1222150
Apr 8248178
Apr 15301212
Apr 22277236
Apr 29336264
May 6365311
<AreaChart
  title="Area Chart - Interactive"
  xKey="date"
  data={traffic}
  series={[
    {key: 'desktop', label: 'Desktop'},
    {key: 'mobile', label: 'Mobile'}
  ]}
  metrics={[
    {label: 'Desktop', value: '1,749', color: 'var(--uin-chart-1)'},
    {label: 'Mobile', value: '1,351', color: 'var(--uin-chart-2)'}
  ]}
/>

Stacked

Area Chart - Stacked Multiple series stacked on a shared baseline. Desktop Mobile Tablet
Area Chart - StackedMultiple series stacked on a shared baseline.0200400600JanFebMarAprMayJun
Area Chart - Stacked
monthDesktopMobileTablet
Jan1868042
Feb30520072
Mar23712054
Apr27319066
May20913058
Jun21414063
<AreaChart
  title="Area Chart - Stacked"
  xKey="month"
  data={areaMix}
  stacked
  series={[
    {key: 'desktop', label: 'Desktop'},
    {key: 'mobile', label: 'Mobile'},
    {key: 'tablet', label: 'Tablet'}
  ]}
/>

Expanded

Area Chart - Expanded 100% stacked area for share over time. Desktop Mobile Tablet
Area Chart - Expanded100% stacked area for share over time.0%25%50%75%100%JanFebMarAprMayJun
Area Chart - Expanded
monthDesktopMobileTablet
Jan1868042
Feb30520072
Mar23712054
Apr27319066
May20913058
Jun21414063
<AreaChart
  title="Area Chart - Expanded"
  xKey="month"
  data={areaMix}
  expanded
  series={[
    {key: 'desktop', label: 'Desktop'},
    {key: 'mobile', label: 'Mobile'},
    {key: 'tablet', label: 'Tablet'}
  ]}
/>

Props

PropTypeDefaultDescription
dataChartDatum[]Rows to plot. Each row must include the xKey and every series key.
seriesChartSeries[]Series config with key, label, color, icon, and unit metadata.
xKeystring'x'Field used for the x-axis value.
curve'linear' | 'monotone' | 'step''monotone'D3 curve interpolation for the area and top line.
stackedbooleanfalseStack series on top of each other.
expandedbooleanfalseRender a 100% stacked area chart.
metricsChartMetric[][]Optional header metrics rendered by ChartFrame.

Install

CLI

npm install d3-array d3-scale d3-shape
npx @a3tai/mittsu add area-chart --registry ./packages/charts/registry.json