Installation
Theme
Mode

Data viz

Area chart

A line chart with the ground filled in — for volume and cumulative totals over time. Same SVG foundation and theme as the rest of the family, with a soft top-down gradient under each series. One component, three fills.

$npx shadcn@latest add @orbit/area-chart

Overview

Cumulative throughput with a gradient fill. Hover the plot for the crosshair and tooltip.

Cumulative throughput — last 8 weeks
Cumulative throughput
Last 8 weeks · hover the plot
+95%

Variants

A single variant moves from one filled series, to stacked volumes, to a 100% composition that shows share rather than amount.

single — one series with a gradient fill
stacked — series piled into a running total
DesignBuildReview
percent — normalized to share, composition over time
DesignBuildReview
curve="linear" — straight segments for sharp movement

Options

The gradient derives from the accent, so recoloring is one prop. Drop the grid for a sparkline-like look.

accent="var(--acc)"
showGrid=false · accent="var(--warning)"

In context

An effort-mix panel — where the work went each month, with a working Volume / Share toggle.

Total effort
612+22%
Peak month
98Jul
Build share
58%+5%
Effort by phase
DesignBuildReview

Props

PropTypeDefaultDescription
variant"single" | "stacked" | "percent""single"single plots data; stacked/percent plot categories + series. percent normalizes each column to 100%.
curve"smooth" | "linear""smooth"Monotone curve or straight segments.
data{ label: string; value: number }[]Single-series points for the single variant.
categoriesstring[]X labels for stacked | percent.
series{ name: string; values: number[]; color?: string }[]Stacked band values, bottom band first. Colors default to the fixed CHART_SERIES palette by position.
accentstring"var(--pri)"Single-series stroke + gradient color (any token or color-mix).
heightnumber340Total height in px, legend included. Width is responsive.
showGridbooleantrueHorizontal hairline gridlines.
showLegendbooleantrueLegend under stacked variants. Never rendered for one series.
namestring"Value"Single-series name shown in the tooltip.
formatValue(v: number) => stringStringFormats tooltip and axis values (percent shows shares).
ariaLabelstringPlain-language summary for the chart's role=“img”.
…restHTMLAttributes<HTMLDivElement>Forwarded to the root div, including ref and className.

Usage

The filled area emphasizes volume and accumulation — use it when magnitude matters, not just direction.

Do

Use for volume over time

The fill reads as accumulated quantity — ideal for throughput, traffic, or burn-up.

Don’t

Overlap opaque areas

Stack series instead of layering solid fills, or front areas hide the ones behind.

Do

Switch to 100% for share

When the mix matters more than the total, normalize so each band shows its percentage.

Don’t

Stack more than ~4 bands

Thin middle bands get impossible to read — group the long tail into “Other”.

Keyboard & accessibility

The chart renders as a labelled image; the crosshair tooltip reads every band at the hovered point, top band first.

roleimg with an aria-label summary of the data
TooltipPer-series value or share at the hovered x
LegendNames bands beyond color alone
ContrastBand strokes hold ≥ 3:1 over the fills