Area chart
Fills amounts over time from zero, stacked into their total.
Preview
Local preview. It doesn't affect real accounts, environments, or run data.
Compare the same example at each size and density. Switching keeps input values and selection state. Size guidance and comparisons
Six sample days. Workspace rises from 12 to 27 runs. Inventory has no measurement on October 3, so the chart leaves a gap there.
Pipeline run count (runs)
Reporting day
Focus the chart and use Left/Right to inspect points. Escape clears details. The data table includes every series.
View data table
All series are visible.
Usage
Fill amounts along time as areas, such as disk used or tokens by project, and stack them so the top of the stack is their total. The fill is an amount, so an area always rises from zero on a linear axis. Always provide a title, a factual summary, and axis names with units. Series default to brand and neutral fills, told apart by fill patterns, dashes and markers; pass palette="categorical" when color must separate categories, such as projects, or palette="extended" for a chart with more series than twelve; dashes={false} draws the tops solid. stacked adds the series into their total, which the readout names; a comparison or a plan, such as a target, draws as its line alone and stays out of the total. With xScale="time", rows sit by data[].time and an area breaks where sampling stops, or past breakAfter; curve="step" holds values sampled on change, such as disk used. references draw thresholds and target bands, and mark events and periods on the x axis. In a dashboard card, density="compact" keeps the plot, legend and floating values; minimal leaves the marks alone. Pass data as an immutable array that the caller owns.
- Don't fill values far from zero, such as a price, or values orders of magnitude apart: the fill would claim an amount that isn't there. Use LineChart, with includeZero={false} or yScale="log".
- Don't stack series that don't add up, such as a temperature per node. Stack only parts of a total, and draw the rest with LineChart.
- Don't stack many series where you can choose: each layer rides on the ones below it, so only the lowest and the total read their own change. Keep the largest, sum the rest as Other, or use LineChart to compare their change.
- Don't mix units on one axis. Use separate charts instead.
- Don't replace missing values with 0. Pass null instead: the chart treats null, undefined, NaN, and Infinity as missing and breaks the area there.
- Don't expect the chart to show loading, error, or retry states. Build them in the product screen.
- Don't expect the description prop to be an automatically inferred analysis. It holds the caller's factual summary.
Size: SizeProvider size="small" resizes the whole composition, including portals. The default size is Default. Size guidance and comparisons
Anatomy
figure → figcaption(title + summary) + legend toggle buttons + named axes + responsive Recharts ComposedChart + persistent inline value readout + details → Table.Container → full data table
Keyboard and accessibility
- Tab reaches the legend buttons, the chart, and the data table toggle.
- With the chart focused, Left and Right move between data points.
- Enter or Space on a legend button shows or hides its series, and aria-pressed reports whether it's shown. Hidden series stay in the data table.
- View data table is a native details element that Enter or Space expands. Long tables scroll on both axes. Each series header names the unit once, and the cells hold full values aligned at the end.
- Escape clears the details, and an arrow key shows them again.
- Pointer, touch and the arrow keys show the point's values in a box beside it, which turns to whichever side has more room and stays inside the plot. The same values fill the details region below the plot, a polite live region that never covers the marks; the box itself stays out of the accessibility tree.
- Circle, square, and triangle markers and line patterns, with the fill patterns under them, tell series apart beyond color. They remain in high contrast mode.
- With dashes off the markers carry that difference alone, so a chart drawn solid keeps its markers even past 40 points, where a chart drawn with dashes drops them.
- Above 40 points, the plot omits markers to reduce overlap. Legend markers, line patterns, details, and the table remain.
- Animation is off by default.
- While the chart's room keeps changing, as while a sidebar slides or a window edge is dragged, the plot holds the width it was drawn at, clipped to the chart, and redraws once the room settles. A single change of room draws at once.
- Test real assistive technology usability separately after product integration.
Give each control a name that describes its purpose. Connect error messages to their controls, and signal state with more than color. Automated checks don't replace manual keyboard and assistive technology testing.
Example code
Shared components take their styles from design tokens. Each example sets its own composition and accessibility attributes. The calling screen defines callbacks, refs, and product data.
Key API
The table lists the common wrapper's main props. See the package type declarations for the full types.