Skip to content
SENVENLI UI

Scatter chart

Points on two value axes, for seeing a relation and outliers.
Price and units sold
import { ScatterChart } from "@senvenli/react/charts";

Examples

A second category and a size

The second group differs by shape as well as color; a third measure sets the point's size.

With a trend line

A least-squares line shows the direction of the relation.

Guidelines

When to use it

  • How two measures of the same items relate.

Use something else when

Accessibility

Keyboard

KeysWhat happens
Arrow keysMove between points.

Built in

  • A "Show as table" button shows the same data as a table, which screen readers get by default.

You provide

  • A title that says what the figure is.

API reference

ScatterChart

title
string

What the chart shows, over it; leave it out when a card or a heading already says so.

aria-label
string

Names the chart when it has no visible title (a card's heading already says what it shows).

period
string
isLoading
boolean
emptyState
React.ReactNode

Shown instead of the plot when there is no data: an EmptyState size="small" or text; "No data" by default.

height
number
dataRequired
readonly T[]
nameRequired
keyof T & string

The key naming each point (a product's SKU); shown on hover and as the table's row header.

xRequired
keyof T & string
yRequired
keyof T & string
size
keyof T & string

A third measure as point size.

category
{ key: keyof T & string; value: unknown; label: string; otherLabel: string; }

A second category: ds-chart-2 and a diamond, so it differs by shape as well as hue.

xLabelRequired
string

Axis names with their units ("Daily price (€)").

yLabelRequired
string
valueFormatters
{ x?: ChartValueFormatter | undefined; y?: ChartValueFormatter | undefined; }
trendLine
boolean

A least-squares trend line, dashed in ds-chart-neutral.

onPointPress
(row: T) => void

Opens the item: the row under the pointer.