Documentation / Charts
AreaChart
The same engine as LineChart, with the quantity filled in. Where a line is read for its slope, an area is read as a quantity: its axis anchors at zero.
Three modes through stack: none (a wash under each line, readable for two or three series), stacked (the total) and percent (the composition, axis locked to 0–100 and a tooltip giving the raw value and its share). Stacked bands are separated by 2 px of the background colour, never by a border.
A "use client" component. patterns adds a texture per stacked series when the hue is not enough (severe colour blindness, grayscale printing); off by default, it is an accessibility option.
Examples
Simple area
A single series is drawn as a wash under its line, anchored at zero.
import { AreaChart } from "@synertech/ui";
const traffic = [
{ quarter: "T1 2025", web: 18400, mobile: 9200, api: 3100 },
{ quarter: "T2 2025", web: 21100, mobile: 12050, api: 4200 },
{ quarter: "T3 2025", web: 19800, mobile: 14600, api: 5400 },
{ quarter: "T4 2025", web: 26500, mobile: 19100, api: 7300 },
{ quarter: "T1 2026", web: 29200, mobile: 24800, api: 9100 },
{ quarter: "T2 2026", web: 31800, mobile: 31400, api: 12600 },
];
export function Basic() {
return (
<AreaChart
title="Sessions web"
data={traffic}
x={{ key: "quarter", label: "Trimestre" }}
series={[{ key: "web", label: "Web" }]}
height={240}
/>
);
}Stacked
stack="stacked" adds the series up: the top of the last band is the total.
import { AreaChart } from "@synertech/ui";
const traffic = [
{ quarter: "T1 2025", web: 18400, mobile: 9200, api: 3100 },
{ quarter: "T2 2025", web: 21100, mobile: 12050, api: 4200 },
{ quarter: "T3 2025", web: 19800, mobile: 14600, api: 5400 },
{ quarter: "T4 2025", web: 26500, mobile: 19100, api: 7300 },
{ quarter: "T1 2026", web: 29200, mobile: 24800, api: 9100 },
{ quarter: "T2 2026", web: 31800, mobile: 31400, api: 12600 },
];
const channels = [
{ key: "web", label: "Web" },
{ key: "mobile", label: "Mobile" },
{ key: "api", label: "API" },
];
export function Stacked() {
return (
<AreaChart
title="Sessions par canal"
description="Le total et sa décomposition"
data={traffic}
x={{ key: "quarter" }}
series={channels}
stack="stacked"
legendToggle
height={260}
/>
);
}100% stacked
stack="percent" shows each channel’s share; the tooltip keeps the raw value.
import { AreaChart } from "@synertech/ui";
const traffic = [
{ quarter: "T1 2025", web: 18400, mobile: 9200, api: 3100 },
{ quarter: "T2 2025", web: 21100, mobile: 12050, api: 4200 },
{ quarter: "T3 2025", web: 19800, mobile: 14600, api: 5400 },
{ quarter: "T4 2025", web: 26500, mobile: 19100, api: 7300 },
{ quarter: "T1 2026", web: 29200, mobile: 24800, api: 9100 },
{ quarter: "T2 2026", web: 31800, mobile: 31400, api: 12600 },
];
const channels = [
{ key: "web", label: "Web" },
{ key: "mobile", label: "Mobile" },
{ key: "api", label: "API" },
];
export function Percent() {
return (
<AreaChart
title="Part de chaque canal"
description="La composition, plus le volume"
data={traffic}
x={{ key: "quarter" }}
series={channels}
stack="percent"
curve="linear"
height={260}
/>
);
}Accessibility textures
patterns cuts a texture into each band (the first stays solid); the legend swatch carries the same one.
import { AreaChart } from "@synertech/ui";
const traffic = [
{ quarter: "T1 2025", web: 18400, mobile: 9200, api: 3100 },
{ quarter: "T2 2025", web: 21100, mobile: 12050, api: 4200 },
{ quarter: "T3 2025", web: 19800, mobile: 14600, api: 5400 },
{ quarter: "T4 2025", web: 26500, mobile: 19100, api: 7300 },
{ quarter: "T1 2026", web: 29200, mobile: 24800, api: 9100 },
{ quarter: "T2 2026", web: 31800, mobile: 31400, api: 12600 },
];
const channels = [
{ key: "web", label: "Web" },
{ key: "mobile", label: "Mobile" },
{ key: "api", label: "API" },
];
export function WithPatterns() {
return (
<AreaChart
title="Sessions par canal"
description="Lisible sans la couleur"
data={traffic}
x={{ key: "quarter" }}
series={channels}
stack="stacked"
patterns
height={260}
/>
);
}Dashboard panel
Value format, target, table view, export in the actions slot, and loading / error states driven by the request.
import { AreaChart } from "@synertech/ui";
const traffic = [
{ quarter: "T1 2025", web: 18400, mobile: 9200, api: 3100 },
{ quarter: "T2 2025", web: 21100, mobile: 12050, api: 4200 },
{ quarter: "T3 2025", web: 19800, mobile: 14600, api: 5400 },
{ quarter: "T4 2025", web: 26500, mobile: 19100, api: 7300 },
{ quarter: "T1 2026", web: 29200, mobile: 24800, api: 9100 },
{ quarter: "T2 2026", web: 31800, mobile: 31400, api: 12600 },
];
const channels = [
{ key: "web", label: "Web" },
{ key: "mobile", label: "Mobile" },
{ key: "api", label: "API" },
];
export function Dashboard() {
const loading = false;
const failed = false;
return (
<AreaChart
title="Trafic total"
description="Six derniers trimestres"
data={traffic}
x={{ key: "quarter" }}
series={channels}
stack="stacked"
y={{ format: (value) => `${Math.round(value / 1000)} k` }}
referenceLines={[{ value: 60000, label: "Objectif T2" }]}
tableView="toggle"
loading={loading}
error={failed}
onRetry={() => console.log("Nouvelle tentative")}
locale="fr-FR"
height={260}
/>
);
}API reference
Components
Change over time, with the quantity filled in.
Same engine as the line chart, plus the fill and the stacking. Where a line is read for its slope, an area is read as a quantity, so its axis anchors at zero by default.
A single area is a wash under its line. A stack is a composition: solid bands, separated by 2px of the surface colour rather than by a border drawn around each one.
import { AreaChart } from "@synertech/ui";Props — AreaChartProps
| Prop | Type | Default | Description |
|---|---|---|---|
data• |
ChartDatum[] |
— | |
series• |
ChartSeries[] |
— | |
x• |
ChartXAxisConfig |
— | |
actions |
ReactNode |
— | Slot on the right of the caption: an export button, a range picker. A filter that frames several panels belongs in a |
annotations |
ChartAnnotation[] |
— | What happened, drawn where it happened: a release, a campaign, an outage. The counterpart of |
baseline |
number |
0 |
Value the fill is measured from when nothing is stacked. |
brush |
boolean |
false |
Lets a pointer drag a window across the category axis. Shift + arrows does the same from the keyboard, Escape drops it, and the window is published to the surrounding |
brushLabel |
string |
— | Accessible name of the selected window. |
className |
string |
— | |
connectNulls |
boolean |
false |
|
curve |
ChartCurve |
"monotone" |
|
description |
ReactNode |
— | |
emphasis |
string |
— | Paints one series in its colour and greys out every other one. |
emptyState |
ReactNode |
— | Replaces the "no data" state: usually an |
error |
boolean |
false |
The data could not be loaded. Never the same thing as having none: a panel that says "no data" after a failed request states something false, and offers no way out. |
errorState |
ReactNode |
— | Replaces the whole built-in error state, message and button included. |
grid |
ChartGridLines |
"y" |
|
height |
number |
240 |
Height of the plot area in pixels. Width always follows the container. |
legend |
boolean | ChartLegendPosition |
— | |
legendToggle |
boolean |
true |
|
loading |
boolean |
false |
Dims the plot while fresh data loads; a first load shows a spinner. |
locale |
string |
— | BCP 47 tag the numbers and the dates are written in. Defaults to the |
margin |
Partial<ChartMargin> |
— | |
maxPoints |
number |
— | Thins the drawn bands to roughly this many points per series. Runs the path through LTTB, which keeps the peaks a stride sample walks straight past. Only the paths are thinned: the geometry, the crosshair, the tooltip and the data table keep reading every row. Left unset, a series past |
onBrush |
(range: ChartBrushRange | null) => void |
— | Called when a window is set, and with |
onPointClick |
(event: ChartPointEvent) => void |
— | Called with the mark that was clicked. Enter and Space on the focused chart do the same for the mark the keyboard is on. |
onRetry |
() => void |
— | Draws the retry button in the error state, and is called when pressed. |
overlay |
ChartOverlay |
— | Draws inside the plot, with the chart's own resolved geometry. |
patterns |
boolean |
false |
Draws each band with a texture on top of its colour. The channel a reader falls back on when the hue fails them: severe colour vision deficiency, a grayscale print, a forced-colours theme. Off by default — it is an accessibility option, not a decoration. Only the bands of a stack take one. An overlay's fill is a 12% wash, thin enough that no texture survives it, and there the identity is carried by the edge line rather than by the surface under it. |
plotLabel |
string |
— | |
referenceLines |
ChartReferenceLine[] |
— | |
size |
ChartSize |
"md" |
|
stack |
ChartStackMode |
"none" |
How the series share the value axis.
|
sync |
boolean |
true |
|
tableView |
boolean | "toggle" |
false |
Renders the accessible data table: always ( |
title |
ReactNode |
— | |
tooltip |
boolean | ((payload: ChartTooltipPayload) => ReactNode) |
true |
|
width |
number |
— | Fixes the width instead of measuring the container. |
y |
ChartYAxisConfig |
— |
+ 276 inherited native attributes from HTMLAttributes, AriaAttributes, DOMAttributes (className, id, aria-*, event handlers…).