Skip to content
misoto22 design

Charts

AreaChart

A filled series over a continuous axis, where the area means something.

When to reach for it

Reading one magnitude over time. Comparing several series against each other is a LineChart — four translucent fills stacked on each other answer neither question.

Examples

default

Visitors per month
Visitors per month
monthDesktopMobile
Jan18680
Feb305200
Mar237120
Apr273190
May209130
Jun314240

fill variants

Visitors per month — gradient fill
Visitors per month — gradient fill
Desktop
186
305
237
273
209
314

stroke and curve

Visitors per month
Visitors per month
Desktop
186
305
237
273
209
314

stacking

Visitors per month — stacked
Visitors per month — stacked
DesktopMobile
18680
305200
237120
273190
209130
314240

dots and reveal

Visitors per month
Visitors per month
Desktop
186
305
237
273
209
314

brush

Visitors per day
Visitors per day
dayDesktop
D1140
D2164
D3185
D4202
D5214
D6220
D7219
D8211
D9199
D10184
D11169
D12154
D13143
D14136
D15136
D16142
D17155
D18173
D19195
D20219
D21242
D22263
D23280
D24291
D25295
D26293
D27285
D28273
D29257
D30242
D31227
D32217

loading

Visitors per month
Loading

chroma palette

Visitors per month
Visitors per month
monthDesktopMobileTablet
Jan1868040
Feb30520072
Mar23712055
Apr27319088
May20913061
Jun31424096

annotations

Visitors per month
Visitors per month
monthDesktop
Jan186
Feb305
Mar148
Apr162
May289
Jun341

empty

Visitors per month

No visits in this range

This project had no traffic before March. Try a wider range.

sonify

Visitors per month
Visitors per month
monthDesktop
Jan186
Feb305
Mar148
Apr162
May289
Jun341

Notes

A filled series over a category axis — the shape for a magnitude that is continuous, where the area under the line means something.

Composed rather than configured: axes, grid, tooltip, legend and the areas themselves are children, so a chart renders exactly the parts it asked for and nothing is switched on by a prop nobody can see.

Reach for <LineChart> instead when the reader is comparing several series against each other rather than reading one total, and for <BarChart> when the categories are discrete.

Props

AreaChart props
PropTypeDefaultDescription
childrenrequiredReactNodeThe composed parts — axes, grid, tooltip, legend, and the marks themselves.
configrequiredTConfig & ValidateKeys<TData, TConfig>Series keys → their label and paint. Declaration order is ramp order.
datarequiredTData[]The rows the chart draws. One entry per point, bar or category.
titlerequiredstringWhat the chart shows, in a sentence a reader could act on. Required, and announced to a screen reader even when it is not printed.
animationTypeChartRevealType'forward'The intro wipe every `<AreaChart.Area>` inherits.
chartPropsComponentProps<typeof RechartsAreaChart>Escape hatch onto the raw Recharts chart element.
classNamestringMerged onto the figure, last, so a call site can size or space it.
curveTypeChartCurveType'linear'The curve every `<AreaChart.Area>` inherits.
defaultSelectedDataKeystring | nullnullThe series lit on first render. Selection dims every other series.
descriptionReactNodeA line under the title — the unit, the window, the caveat.
emptyChartEmptyProps | falseWhat the chart shows when it has nothing to draw. Rendered instead of the plot whenever `data` is empty and the chart is not loading — the state a real dashboard reaches within a week, and the one an empty pair of axes is indistinguishable from a failed load. `false` keeps the axes, for a chart whose emptiness is itself the reading.
hideDataTablebooleanfalseDrops the hidden table view. Only correct when the page prints the data itself.
isLoadingbooleanfalseSwaps the marks for an animated skeleton, keeping the measured height so the page does not jump when the data lands.
loadingPointsnumberHow many points the skeleton draws.
onSelectionChange(selectedDataKey: string | null) => voidFires when the selection changes, and with null when it is cleared.
showTitlebooleanPrints the title above the plot instead of hiding it from sight.
stackTypeAreaStackType'default'How several marks combine: side by side, stacked, or normalised to 100%.
xDataKeykeyof TData & stringThe row field on the category axis. Needed by the brush and by the table view.

Types

TSX
export type ChartCurveType = ComponentProps<typeof RechartsArea>['type']
export type AreaVariant = 'gradient' | 'gradient-reverse' | 'solid' | 'dotted' | 'lines' | 'hatched'
export type AreaStrokeVariant = 'solid' | 'dashed' | 'animated-dashed'
export type AreaStackType = 'default' | 'stacked' | 'expanded'

Keyboard

AreaChart keyboard interactions
KeyDoes
TabReaches the plot, which Recharts’ accessibility layer makes navigable.
Moves the cursor between points, announcing each.

Accessibility

  • title is required and becomes the figure’s accessible name, printed or not.
  • The rows are rendered again as a visually hidden table, so the numbers are reachable rather than only drawn. hideDataTable opts out when the page already prints them.
  • Six fill variants exist because in the monochrome default TEXTURE is the primary carrier of identity and the grey ramp is the second — which is also what keeps two series apart in greyscale print and under forced colours.
  • The intro reveal is a per-frame SVG mask and is dropped entirely under prefers-reduced-motion, as is the crawling dash.