Skip to content
Browse docs and components

Chart

chart

The tooltip and legend every Forme chart shares: a floating panel with a colour, a name and a right-aligned value per series, and a row of swatches. Installed with any chart; use them directly to give a chart of your own the same finish.

Responsive

Install

$npxshadcnadd@forme/chart

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

ChartTooltip

The tooltip every Forme chart renders: a floating panel with a heading, then one row per series with its colour, its name and its value right-aligned in tabular figures so a column of numbers lines up.

PropTypeDefaultDescription
rows*readonly ChartTooltipRow[]—
titlestring—
indicator"dot" | "line""dot"dot for bars and areas, line for lines, matching what the series looks like.

ChartLegend

A row of swatches naming each series, in the order its colours were assigned.

PropTypeDefaultDescription
items*readonly { label: string; color: string }[]—
indicator"dot" | "line""dot"
classNamestring—