AreaChart

A filled area chart for emphasising volume and cumulative values over time.

Installation

npx dafink-ui add area-chart

Requires: recharts

Demo

Props

NameTypeDefaultDescription
dataChartDataPoint[]-Array of data objects.
xKeystring-Key to use as the x-axis label.
seriesChartSeries[]-Areas to render.
stackedbooleanfalseStack areas on top of each other.
heightnumber240Chart height in px.
showLegendbooleantrueWhether to show the legend.
showGridbooleantrueWhether to show the background grid.
classNamestring""Extra classes applied to the container.

Accessibility

AreaChart behaves like LineChart: the SVG root is Tab-focusable, ArrowLeft/ArrowRight step a shared tooltip across the x-axis, and Enter pins it; the wrapping div carries role="img" and aria-label="Area chart". Because it supports stacked, the stepped tooltip lists every series' value at that x-axis index at once, not just the one nearest the pointer; the legend renders static labels only.