Skip to content
WunderUI

Area Chart

Pro

Area chart for volumes over time: gradients, steps, ranges, a horizon graph, differences and target lines.

Playground Area Charts

Area Charts

Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Area Charts, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct46k33k
Nov53k38k
Dec58k35k

Playground Layers

Area Charts

Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k; Expenses from 18k to 35k, lowest 18k, highest 38k; Refunds from 8k to 24k, lowest 8k, highest 24k.
Area Charts, data table
monthRevenueExpensesRefunds
Jan32k18k8k
Feb41k22k12k
Mar38k27k10k
Apr47k24k15k
May44k30k13k
Jun52k28k17k
Jul49k34k16k
Aug55k31k20k
Sep51k36k18k
Oct46k33k22k
Nov53k38k19k
Dec58k35k24k

Playground Special

Area Charts

  • Above target
Area chart, 12 points from Jan to Dec. Above target from 34k to 24k, lowest 22k, highest 42k.
Area Charts, data table
monthAbove target
Jan34k
Feb38k
Mar30k
Apr25k
May22k
Jun27k
Jul33k
Aug38k
Sep42k
Oct37k
Nov28k
Dec24k

Playground Hero

Area Charts

  • Revenue
Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k.
Area Charts, data table
monthRevenue
Jan32k
Feb41k
Mar38k
Apr47k
May44k
Jun52k
Jul49k
Aug55k
Sep51k
Oct46k
Nov53k
Dec58k

Installation

Area Chart comes with WunderUI Core and Pro, in the package from your plan. See the plans.

The charts live in their own entry point: import the chart, its card and its hooks from @wunderui/react/charts, not from @wunderui/react.

Then import what you need:

tsx
import {
  AreaChart,
  AreaChartProps,
  AreaChartVariant,
} from "@wunderui/react/charts"

Then use it:

tsx
import { AreaChart } from "@wunderui/react/charts"

const data = [
  { month: "Jan", revenue: 32000 },
  { month: "Feb", revenue: 41000 },
  { month: "Mar", revenue: 38000 },
  { month: "Apr", revenue: 47000 },
]

export function RevenueArea() {
  return <AreaChart data={data} index="month" series={[{ key: "revenue", label: "Revenue" }]} label="Revenue" />
}

Expected result: You should see one filled area over a grid that starts at 0, with the months below. Hovering shows a crosshair and a tooltip.

When to use

Use Area Chart for

  • Volumes over time, where the filled area carries the message
  • A total made of overlapping series (requests, sessions)
  • A band around a value (a range of temperatures), or the gap between two series
  • Several signals stacked as horizon rows

Use something else for

  • Line Chart for exact values and many series that would hide each other
  • Stacked Chart for the parts of a total, stacked on top of each other
  • River Chart for a mix that changes over time, centred on a baseline
  • Sparkline for a small trend without axes

States

Loading, empty and error keep the chart's size, so the card never jumps. Add a retry handler and the error state offers a Try again button.

Area Charts

Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Area Charts, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct46k33k
Nov53k38k
Dec58k35k

Forecast

forecastFrom marks where the forecast starts: a dashed divider with its label, and from there the fill turns to stripes and the outline dotted. The legend names Actual and Forecast.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k.
Revenue with forecast, data table
monthRevenueRevenue forecast
Jan32k–
Feb41k–
Mar38k–
Apr47k–
May44k–
Jun52k–
Jul49k–
Aug55k–
Sep51k–
Oct–54k
Nov–58k
Dec–61k

Trendline

trendline draws the least-squares line through each series, dotted in a lighter step of its colour. Pass true for every series or a list of keys.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses with trendlines, data table
monthRevenueRevenue trendExpensesExpenses trend
Jan32k36.3k18k21.2k
Feb41k38.5k22k22.7k
Mar38k40.7k27k24.3k
Apr47k43k24k25.8k
May44k45.2k30k27.3k
Jun52k47.4k28k28.9k
Jul49k49.6k34k30.4k
Aug55k51.8k31k32k
Sep51k54k36k33.5k
Oct54k56.3k33k35.1k
Nov58k58.5k38k36.6k
Dec61k60.7k35k38.2k

Event markers

events pins what happened to the area: a dotted line over the plot and an icon button above it. Hover or focus a button for the label and detail; two events at one point share a button with a counter.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses with events, data table
monthRevenueExpensesEvents
Jan32k18k–
Feb41k22k–
Mar38k27kPrice change: Pro plan from $19 to $24 a month
Apr47k24k–
May44k30k–
Jun52k28k–
Jul49k34kSummer campaign: Paid social in three markets
Aug55k31k–
Sep51k36k–
Oct54k33kRelease 2.0: Team workspaces and SSO
Nov58k38k–
Dec61k35k–

Range

range highlights a stretch of categories with grey stripes behind the area, with an optional label at the top.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses with the summer sale, data table
monthRevenueExpensesSummer sale
Jan32k18k–
Feb41k22k–
Mar38k27k–
Apr47k24k–
May44k30k–
Jun52k28kYes
Jul49k34kYes
Aug55k31kYes
Sep51k36k–
Oct54k33k–
Nov58k38k–
Dec61k35k–

Range band

rangeBand wraps a series in the span between two fields — strongest at the outline, lighter towards the dashed edges — and fades out at both ends. The tooltip shows the value and its span.

Revenue

  • Revenue
Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k.
Revenue with its expected range, data table
monthRevenueRevenue lowRevenue high
Jan32k29k35.3k
Feb41k37k45.4k
Mar38k34k42.4k
Apr47k42k52.5k
May44k39k49.5k
Jun52k46k58.6k
Jul49k43k55.6k
Aug55k49k61.6k
Sep51k44k58.7k
Oct54k46k62.8k
Nov58k49k67.9k
Dec61k51k72k

Patterns

pattern fills the areas with one form from the shared pattern library — stripes, dots or cross-hatch — drawn in each colour on a tint of it, for print and for readers who cannot tell the colours apart. One form per chart; a mark under 20 px on its shorter side stays solid.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct54k33k
Nov58k38k
Dec61k35k

Background texture

texture swaps the grid lines for a quiet background behind the areas — dots, diagonal lines or a fine grid in the grid colour, faded out at all four edges. It replaces the grid, never adds to it; the zero line stays for the marks to stand on. One decorative layer per chart: no texture together with a pattern or a glow.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct54k33k
Nov58k38k
Dec61k35k

Ghost trail

ghost draws the previous period behind the current one as a faint line with a whisper of fill, in the series colour at --chart-hidden. Pass the field that holds last period's value, or { key, label, series }. The tooltip lists it under its series, the data table adds a column, and the legend shows it as a faint ring (ghost: true).

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 61k, lowest 32k, highest 61k.
Revenue against last year, data table
monthRevenueLast year
Jan32k27k
Feb41k33k
Mar38k35k
Apr47k39k
May44k42k
Jun52k44k
Jul49k41k
Aug55k47k
Sep51k49k
Oct54k46k
Nov58k50k
Dec61k53k

Table view

Every chart carries a table of its data for screen readers. A ChartCard can show it on screen too, with a toggle in the header.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct46k33k
Nov53k38k
Dec58k35k

Keyboard interactions

The plot is focusable, so the chart works without a pointer.

TaborShiftTab
Moves focus to the plot and away from it. The plot is one tab stop; so is every legend badge.
ArrowRightorArrowLeft
Moves to the next or previous point. The tooltip follows, and a live region announces the one you are on. The first press starts at the first one (Left: the last one).
HomeorEnd
Jumps to the first or last point.
ShiftArrowRightorShiftArrowLeft
Extends a selected range from the point you started on. A range is only selected when is set.
Escape
Clears the active point and the selected range.
EnterorSpace
On a legend badge of a ChartCard: switches its series off or on. The last visible series stays on.

Behavior and motion

What the chart does on its own and what the page decides.

Variants set the fill
The variant picks the fill, the curve (smooth or step) and the layers (band, target line, difference, threshold). A separate curve setting overrides the outline.
Order
Overlapping series are drawn in series order, so the first one sits at the back. Put the largest first.
Baseline
Areas are clipped to the plot and never draw below the baseline, even on a smooth curve.
Horizon graph
The horizon graph gives each series its own row and folds values into bands of deepening shade: positive in the series colour, negative in red.
Texture and ghost trail
A texture replaces the grid, never adds to it, and only one decorative layer goes on a chart (no texture with a pattern or a glow). The ghost trail draws last period faint behind the current one and morphs with the data.
Hero variants
glow-area is a named hero variant: the gradient fill under a glowing outline that ends on a dot. Never a default and never in a dense dashboard; with reduced motion the glow is off.
Loading, empty and error
The chart keeps its size while it loads, is empty or fails, so the card never jumps. Loading shows a skeleton; error adds a Try again button when a retry handler is set.
Legend
A ChartCard shows series as badges. With two or more series each badge switches its series off, the last visible one stays on, and a legend of roles can be made static.
Data table
The chart also renders its data as a table for screen readers, in plot order. A ChartCard can show that table on screen through a toggle that keeps the card height.
Size
The chart fills its container's width; you set the plot height. Text never scales: labels keep their size at every width.

Motion

The enter sequence and the hover follow the motion tokens of the library.

Wipe
Areas wipe in from the left and outlines draw along their path the first time the chart is in view, and again after loading or when new data arrives.
Hover
The crosshair and the ringed points glide from point to point. The horizon graph has no crosshair.
Reduced motion
With reduced motion on, the enter sequence is off and the chart appears at once. Tooltip, crosshair and every state still work.

Anatomy

AreaChart fills the space under a line so the amount reads at a glance. Variants cover solid and gradient fills, overlaps, a positive and negative split, bands, horizon rows and a target line.

Revenue

Area chart, 12 points from Jan to Dec. Revenue from 32k to 58k, lowest 32k, highest 58k; Expenses from 18k to 35k, lowest 18k, highest 38k.
Revenue and expenses, data table
monthRevenueExpenses
Jan32k18k
Feb41k22k
Mar38k27k
Apr47k24k
May44k30k
Jun52k28k
Jul49k34k
Aug55k31k
Sep51k36k
Oct46k33k
Nov53k38k
Dec58k35k
  • Takes data, an index and series. You can pick smooth, straight or step outlines, change the fill opacity, and mark series that skip the fill or the outline.

  • data-slot="chart-plot"

    The focusable region. Arrow keys walk the points, Shift with an arrow or a drag selects a range, Escape clears it, and hover shows a crosshair and one point per series (not on the horizon graph).

  • data-slot="chart-grid"

    Grid lines from 0 and the same axis rules as other cartesian charts. Areas are clipped to the plot and never draw below the baseline, even on smooth curves.

  • data-slot="chart-marks"

    A fill per series (solid, gradient, reversed gradient or light tint) with a thin outline on top. Overlapping series draw in order, so the first sits at the back.

  • data-slot="chart-horizon"Optional

    The horizon layout: each series gets its own row and values fold into bands of deepening shade, positive in the series colour and negative in red.

  • Optional

    The range band between lower and upper values, the split fill and threshold label of the positive-negative area, and the dashed target series of the target-line area.

  • data-slot="chart-tooltip"Optional

    Category title and one row per visible series, with the change against the previous point on the first series.

  • data-slot="chart-message"Optional

    Loading shows a muted skeleton shaped like the data; empty and error replace the plot with a message.

  • The data as a screen-reader table with a live region for the active point.

Best practices

  • Do

    Overlap at most two series, and give the back one the lighter fill. A third filled area covers the others and makes the lower values unreadable.

  • Do

    For positive and negative values use the positive-negative area with a threshold, not a single colour. The split at the baseline shows which side the value is on without reading the axis.

  • Do

    Use the horizon graph when many series share a short row height, for example 12 services in one card. Mention the fold count in the description, since the bands are not on a shared scale.

  • Do

    Annotate with props instead of drawing on top: forecastFrom (striped forecast fill after a labelled divider), trendline, events (icon buttons with a tooltip), range={{ from, to, label }} (grey stripes behind the area) and rangeBand (a faded band around a series).

  • Don’t

    Don't use a gradient fill to encode data. The fade is decoration; the outline and the tooltip carry the value.

  • Don’t

    Don't stack unrelated series in one plot. For parts of a whole use StackedChart, whose stacking is explicit, instead of areas that merely overlap.

API reference

One table for AreaChart. It is a plain component, so the table lists every prop; the ChartCard around it takes its own props, and the chart works without one.

Takes data, an index and series. You can pick smooth, straight or step outlines, change the fill opacity, and mark series that skip the fill or the outline.

PropTypeDefaultDescription
data requiredreadonly ChartDatum[]—One object per category / point.
index requiredstring—Field holding the category label (x axis; y axis for horizontal bars).
series requiredreadonly ChartSeries[]—The series to draw, in order.
variant"basic-area" | "gradient-area" | "gradient-reverse-area" | "stroke-area" | "dashed-area" | "step-area" | "smooth-area" | "overlap-area" | "positive-negative-area" | "range-area" | "horizon-graph" | "area-with-target-line" | "difference-area" | "area-line-overlay" | "glow-area""basic-area"Figma variant. Default .
valueFormatterChartValueFormatter—Values in tooltip, labels, table and live region. Default: 42000 → "42k".
labelstring—Accessible name, e.g. the card title.
heightnumber—Fixed height of the plot frame in px. Without it the height follows the width (, , ): 220 px on a phone, up to 434 px (the plot of the Figma large card) from about 1130 px wide.
state"ready" | "loading" | "empty" | "error"— shows the chart-shaped skeleton, and a message in the plot.
hiddenSeriesreadonly string[]—Series keys that are switched off (legend toggle): drawn faded, dimmed in the tooltip.
curve"linear" | "smooth" | "step"—Override the variant's curve: straight, monotone smooth or step.
range{ lower: string; upper: string; label?: string } | ChartRangeHighlight—: a highlighted range of categories (grey stripes behind the marks), on every variant. : the min/max band of (fields in each datum) drawn behind the line.
thresholdnumber0: the value the area is split at (default 0).
activeIndexnumber | null—The active point (hovered or focused) as an index into , to control it yourself. shows none.
animateboolean—Enter sequence (draw, wipe, grow) on scroll into view, after loading and on new data. Default true; off with reduced motion.
animationKeystring | number—Change it to play the enter sequence again (e.g. ). New replays it by itself.
aspectRationumber—Width ÷ height when is not set. Default 2.6.
axisFormatterChartValueFormatter—Value-axis labels; defaults to .
categoryAxisboolean—Category-axis labels (default true).
categoryFormatter(label) => string—Shortens category labels on the axis, e.g. "Mar 12" → "Mar"; tooltip and pill keep the full label.
categoryTicksreadonly string[]—Only these category labels are shown on the axis (the rest stay hoverable).
defaultActiveIndexnumber | null—The point that is active at first, for an uncontrolled chart. It shows the tooltip without a pointer.
defaultSelectedRangeChartRange | null—The range that is selected at first, for an uncontrolled chart.
descriptionstring—Screen-reader summary; generated from the data when omitted.
emptyDescriptionstring—Text under the title in the empty state.
emptyTitlestring—Title of the message in the empty state.
errorDescriptionstring—Text under the title in the error state.
errorTitlestring—Title of the message in the error state.
eventsreadonly ChartEvent[]—Event markers: a dotted line over the plot and a round icon button above it; several at one index get a counter badge.
fillOnlyreadonly string[]—Series drawn as a fill only (no outline).
fillOpacitynumber—Opacity of solid fills / top of gradient fills (0…1); each variant has its default.
forecastFromnumber—Index of the first forecast category. From there a dashed divider with a label ("Forecast from Oct"); lines turn dotted and end on a dot, areas fill with stripes, bars are striped with a rim in the series colour.
forecastLabelstring—Label of the forecast divider. Default "Forecast from <category>" (on small charts "Forecast").
ghoststring | ChartGhost—The previous period as a faint ghost behind one series: a field name, or . Areas get a faint line and a whisper of fill. The tooltip lists it under its series, the table adds a column; give the legend item for a faint ring.
gridboolean—Grid lines (default true).
gridFadeboolean—The grid fades out towards both ends (default true).
gridIntervalsnumber—Number of equal grid intervals. Default: one per 44 px of plot height, capped by the size class (xs 2, sm 3, md 3, lg 4, xl 5).
gridStyle"solid" | "dashed"—Grid lines are dashed 4 / 4 by default; draws them through.
horizonBandsnumber2: number of folded bands per row (default 2).
includeZeroboolean—The value axis starts at 0 (owner rule, default). fits the data (prices, temperatures).
lineOnlyreadonly string[]—Series drawn as a line only (no fill), e.g. a benchmark.
maxHeightnumber—Highest height from . Default 434.
minHeightnumber—Lowest height from . Default 220.
onActiveIndexChange(index) => void—Called with the index when the pointer or the arrow keys move to another point, and with when they leave. Use it to show the hovered value in a headline.
onRetry() => void—Shows a Try again button in the error state and calls this when it is pressed.
onSelectedRangeChange(range) => void—Called when a drag across the plot or Shift with an arrow key changes the range, and with when Escape or a click clears it.
patternChartPattern | ChartPattern[]—One pattern form from the shared pattern library (, , …) for every series, drawn in its colour on a tint of it, for print and colour-blind reading. A list keeps its first entry; a mark under 20 px on its shorter side stays solid.
rangeBandChartRangeBand—A band around a series from two fields, faded at both ends with its outline; the tooltip shows "42k · 38k – 47k".
rangeSelectableboolean—Allow selecting a range by dragging or Shift + arrow keys. On when is set.
resolution"auto" | "full"— (default): lines and areas draw at most 1.5 points per pixel (LTTB; hover and tooltip keep every point), and bars on a time axis that would get thinner than they may are gathered into weeks, months … draws every point and eve…
selectedRangeChartRange | null—The selected range as inclusive indices into , to control it yourself. selects nothing.
texture"dots" | "diagonal" | "grid"—, or : a quiet background texture in place of the grid lines (never both), in the grid colour and faded at all four edges; the zero line stays.
thresholdLabelstring—
tooltipboolean—Tooltip on hover / keyboard focus. Default true.
tooltipTitle(datum, index) => ReactNode—Title line of the tooltip; defaults to the category label.
trendlineboolean | readonly string[]—Linear trend (least squares), dotted in a lighter step of the series colour: for every series or a list of series keys.
valueAxisboolean—Value-axis labels (default true). Off for compact cards and sparkline-like plots.
valueAxisPlacement"auto" | "outside" | "inside"—Where the value labels go: left of the plot, in the plot above their grid lines (saves the label column on narrow charts). (default) puts them left of the plot at every size; is opt-in.
valueAxisSide"left" | "right"—Side of the value axis (vertical charts). is the price axis of trading charts.
valueDomainreadonly [number, number]—Fix the value domain instead of fitting it to the data (still rounded to nice steps).
valueTicksreadonly number[]—Exact value-axis ticks (ascending), e.g. [0, 10000, … 70000]; replaces the nice-step domain.
widthnumber—Fixed width instead of filling and measuring the container.
xScale"band" | "time"— (default): the categories sit side by side in equal bands. : the field holds dates (Date, ms or a string such as "2026-03-01"); points sit at their real distance, the axis picks its tick level (hours → days → weeks → m…

Notes for AI

Give your coding assistant the Markdown reference instead of screenshots.

MCPget_component("area-chart")
InstallIncluded in Core and Pro

The full library index for assistants is at /llms.txt.