Synertech Web/ui v0.57.5 Site Storybook

Documentation / Charts

AreaChart

Client@synertech/uiOpen in Storybook

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.

Open in a tab
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.

Open in a tab
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.

Open in a tab
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.

Open in a tab
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.

Open in a tab
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

AreaChart

ComponentClient

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

PropTypeDefaultDescription
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 ChartFilterBar above all of them; this is for what belongs to this panel alone.

annotations ChartAnnotation[] —

What happened, drawn where it happened: a release, a campaign, an outage.

The counterpart of referenceLines, which marks a threshold on the value axis. Bands are drawn under the areas, rules and pinned points over them.

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 ChartSyncProvider.

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 EmptyState saying why, and what to do.

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 locale of UILabelsProvider, then to the language of the runtime.

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 CHART_POINT_BUDGET warns once in development. A stack is thinned once for all its bands, on the rows any of their edges needs, so an edge two bands share is drawn from the same points by both.

onBrush (range: ChartBrushRange | null) => void —

Called when a window is set, and with null when one is dropped.

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.

stacked reads totals, percent reads composition. none overlays the series, which only stays legible for two or three of them.

sync boolean true

false keeps the chart out of the surrounding ChartSyncProvider.

tableView boolean | "toggle" false

Renders the accessible data table: always (true) or behind a button.

title ReactNode —
tooltip boolean | ((payload: ChartTooltipPayload) => ReactNode) true

false disables the hover layer; a function replaces its content.

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…).