Skip to content
Browse docs and components

Scatter Chart

scatter-chart

Two measures against each other, one dot per observation, on TanStack Charts. Groups take their own colour and legend entry, an optional dashed trend line fits each group, and focus finds the nearest point by pointer or arrow keys.

Responsive

Install

$npxshadcnadd@forme/scatter-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.

ScatterChart

Two measures against each other, one dot per observation.

PropTypeDefaultDescription
data*readonly Row[]—
x*NumericKey<Row>—The measure on the horizontal axis.
y*NumericKey<Row>—The measure on the vertical axis.
label*string—Accessible name. Say what is compared with what.
seriesTextKey<Row>—A field that splits the points into groups, each its own colour and legend entry.
xLabelstring—
yLabelstring—
trendbooleanfalseA dashed least-squares line through each group, with its 95% band.
formatX(value: number) => stringplain
formatY(value: number) => stringplain
heightnumber280
classNamestring—