Skip to content
GeneralGenerated from the public API

AreaChart

Compare series and read the change behind them, with the axes, legend and tooltip already wired.

@luc/ui/charts

What it shows

Show a filled magnitude or accumulated trend, where the area between the line and the baseline is part of the reading.

Live preview

Percentage points on the value axis, one filled series, eight observations.

<AreaChart
  data={[
    { date: "2026-08-17", value: 18.4 },
    { date: "2026-08-24", value: 17.1 },
    { date: "2026-08-31", value: 16.6 },
    { date: "2026-09-07", value: 15.2 },
    { date: "2026-09-14", value: 15.9 },
    { date: "2026-09-21", value: 14.4 },
    { date: "2026-09-28", value: 13.8 },
    { date: "2026-10-05", value: 14.1 },
  ]}
  xKey="date"
  axes={[{ id: "primary", format: { kind: "number", decimals: 1, suffix: "%" } }]}
  series={[{ key: "value", label: "Realised vol", type: "area", tone: "accent", axis: "primary" }]}
  interaction={{ zoom: "none" }}
  height={320}
  ariaLabel="Realised volatility"
/>

Controls

Height

320px

A chart measures its container, so it always needs a definite height.

State

The surface the chart is in — loading, empty and error are drawn by the component.

Accessible name

A drawing is not readable by a screen reader, so it needs a name that states what it shows.

The same fixture as the live preview above; the controls change how it is drawn, not what it measures.

Code
import { AreaChart } from "@luc/ui/charts";

<AreaChart
  data={[
    { date: "2026-08-17", value: 18.4 },
    { date: "2026-08-24", value: 17.1 },
    { date: "2026-08-31", value: 16.6 },
    { date: "2026-09-07", value: 15.2 },
    { date: "2026-09-14", value: 15.9 },
    { date: "2026-09-21", value: 14.4 },
    { date: "2026-09-28", value: 13.8 },
    { date: "2026-10-05", value: 14.1 },
  ]}
  xKey="date"
  axes={[{ id: "primary", format: { kind: "number", decimals: 1, suffix: "%" } }]}
  series={[{ key: "value", label: "Realised vol", type: "area", tone: "accent", axis: "primary" }]}
  interaction={{ zoom: "none" }}
  height={320}
  ariaLabel="Realised volatility"
  state="ready"
/>

Not controllable here

  • series / rows — The numbers are the caller's; the fixture above is the example.
Copy for an AI agentA specification an agent can act on: the import, the setup, the chosen props, the data contract and the accessibility expectation.
Implement `AreaChart` from Luc UI. It is: Compare series and read the change behind them, with the axes, legend and tooltip already wired.

Import it with: import { AreaChart } from "@luc/ui/charts";
Requires: react ^19.0.0; react-dom ^19.0.0; react-hook-form ^7.0.0 (optional, for @luc/ui/forms/react-hook-form); tailwindcss ^4.0.0; node >= 22 (repository tools). Import the stylesheet once at the app root and wrap the tree in `LucProvider`. Both come from the package that publishes @luc.

Chosen configuration: `height={320}`, `state="ready"`, `ariaLabel="Realised volatility"`.

Accessibility: keep the component's own semantics. Do not re-implement its ARIA wiring, do not add roles it does not declare, and make sure every interactive element is reachable and operable from the keyboard with a visible focus state.
Styling: use Luc UI design tokens and the component's own props. Do not restyle with raw colour literals and do not override the component's internal structure with page CSS.
Motion: respect `prefers-reduced-motion`. The component already does, so do not disable it.

Reproduce this state:
```tsx
<AreaChart
  data={[
    { date: "2026-08-17", value: 18.4 },
    { date: "2026-08-24", value: 17.1 },
    { date: "2026-08-31", value: 16.6 },
    { date: "2026-09-07", value: 15.2 },
    { date: "2026-09-14", value: 15.9 },
    { date: "2026-09-21", value: 14.4 },
    { date: "2026-09-28", value: 13.8 },
    { date: "2026-10-05", value: 14.1 },
  ]}
  xKey="date"
  axes={[{ id: "primary", format: { kind: "number", decimals: 1, suffix: "%" } }]}
  series={[{ key: "value", label: "Realised vol", type: "area", tone: "accent", axis: "primary" }]}
  interaction={{ zoom: "none" }}
  height={320}
  ariaLabel="Realised volatility"
  state="ready"
/>
```

Usage

The values are prepared by the caller: this component draws the points it is given and computes no statistic of its own, so units, scaling and any summary have to be settled before the data reaches it.

It is drawn by the ECharts engine.

Worked examples with real data are on the family overview: General

import { AreaChart } from "@luc/ui/charts";
<AreaChart
  data={[
    { date: "2026-08-17", value: 18.4 },
    { date: "2026-08-24", value: 17.1 },
    { date: "2026-08-31", value: 16.6 },
    { date: "2026-09-07", value: 15.2 },
    { date: "2026-09-14", value: 15.9 },
    { date: "2026-09-21", value: 14.4 },
    { date: "2026-09-28", value: 13.8 },
    { date: "2026-10-05", value: 14.1 },
  ]}
  xKey="date"
  axes={[{ id: "primary", format: { kind: "number", decimals: 1, suffix: "%" } }]}
  series={[{ key: "value", label: "Realised vol", type: "area", tone: "accent", axis: "primary" }]}
  interaction={{ zoom: "none" }}
  height={320}
  ariaLabel="Realised volatility"
/>

Data contract

`data` rows require an ordered `xKey` and numeric series fields. Each series is a separate magnitude; use `stack` only when the series genuinely add to a total.

Important configuration

Choose `areaGradient` for visual weight, `stack`/`stackMode` for composition, and declare the y format because a filled area often represents a percentage or currency.

Guidelines

When not to use

Do not overlay several unrelated units as filled areas; the occlusion makes the smaller series unreadable and implies a shared baseline.

Configuration

Exported symbols
ExportKindSignature
AreaChart33 documented props<TRow extends object = Record<string, unknown>>({ family, state, height, className, visibleSeries, ariaLabel, ariaDescription, onReady, onEvent, ...spec }: CartesianChartProps<TRow>) => import("@type…

AreaChart props

Type: CartesianChartProps<TRow>

Values the compiler reads from the declaration.

AreaChart props
PropTypeDefaultNotes
animation?ChartAnimationPreset | undefined—Animation budget. Defaults to `standard`.
annotations?AnnotationSpec | undefined—
ariaDescription?string | undefined—
ariaLabel?string | undefined—
axes?readonly AxisSpec[] | undefined—Extra axes beyond the primary one.
className?string | undefined—
data?readonly TRow[] | undefined—
description?string | undefined—
engine?ChartEngine | undefined—
extendOption?((option: unknown) => void) | undefined—Advanced: mutate the assembled engine option. Clearly not the normal path.
family?ChartFamily | undefined—Override the family the wrapper defaults to. Advanced.
height?string | number | undefined—
id?string | undefined—
interaction?ChartInteractionSpec | undefined—
legend?boolean | undefined—
onEvent?((event: EChartEvent) => void) | undefined—
onReady?((chart: EChartsInstance) => void) | undefined—
orientation?"horizontal" | "vertical" | undefined—Bar family only: which way the bars grow. Defaults to `vertical`.
pointCount?number | undefined—The number of plotted points, when the caller already knows it. Used only to *reduce* animation for a large series; it never changes what is drawn.
points?Readonly<Record<string, ChartPointMeta>> | undefined—Per-point display metadata, keyed by the x value's canonical string form. A generic hook for a caller whose x values carry a better label or extra hover context than the axis can …
ranges?ChartRangeSpec | undefined—
renderer?ChartRenderer | undefined—Drawing layer. Defaults to `canvas`. Set `svg` when the chart is going to be captured rather than read: vector output survives PDF export and scales without a density choice. Igno…
scale?{ allowed?: readonly YScaleMode[]; default?: YScaleMode; mode?: YScaleMode; } | undefined—Scale capability and current mode. `allowed` is what the *product* declares it may offer (a signed drawdown is linear-only); `default` is what it opens on; `mode` is what the read…
seriesreadonly SeriesSpec[]—
state?ChartState | undefined—
syncGroup?string | undefined—
title?string | undefined—
tooltip?ChartTooltipSpec | undefined—
unit?string | undefined—
universalTransition?boolean | undefined—Morph the *same data* between two representations (a histogram ↔ a ranked bar, a stacked ↔ a grouped bar). Opt-in, because a morph between charts that do not share a data identity…
visibleSeries?readonly string[] | undefined—
x?AxisSpec | undefined—
xKey?string | undefined—Field that supplies the x value for tabular data.

Accessibility

A chart is a picture of data, so it needs a name that states what it shows, and the numbers must exist as text somewhere on the page — in a table or a written summary — because a drawing is not readable by a screen reader and cannot be copied.

What happens on the server, and when hydration changes it.

Luc UI v1.0AreaChartdark theme