ScatterChart

Scatter plot with variable point radius, multi-series, and hover tooltip.

Category: chart · WCAG 2.1-AA · chart, scatter, plot, data-viz

Props

PropTypeDefaultDescription
seriesScatterChartSeries[]The data series to plot.
titlestringTitle text for the component.
descriptionstringSupporting description text.
rnumber | ((d: ScatterDatum) => number)4Point radius or accessor
widthnumberFixed SVG width in px. ⚠ **Omit for a responsive chart** — the chart fills and tracks its container via a ResizeObserver; there is no correct pixel number in a responsive grid. A fixed width is clamped to the container (max-inline-size: 100%) so it can never overflow its card, but it also stops the chart growing. `useChartSize` is NOT needed for this — charts call it internally.
heightnumber300SVG height in px. Unlike `width`, height does NOT track the container — this is the knob you set to change the chart's aspect.
xTicksnumber5Approximate number of ticks on the x-axis.
yTicksnumber5Approximate number of ticks on the y-axis.
legendbooleanWhether to show the legend.
tooltipbooleanEnable hover/keyboard tooltip
classNamestringAdditional CSS class names merged onto the root element.
plainbooleanfalseMarks only — no axes, grid lines, or legend. For micro/inline charts.
annotationsAnnotation[]Reference lines, shaded bands, and markers drawn over the plot (e.g. a target/threshold line).
onSelect(point: ChartPoint) => voidFired when a point is clicked or activated (Enter/Space) — for drill-down.
glyphGlyphShape | ((d, seriesId) => GlyphShape)Point glyph shape (circle/square/diamond/triangle/cross/star) — a fixed shape or a function to encode a category by shape.
renderer'svg' | 'canvas' | 'auto'svgRenderer — svg (default), canvas (force), or auto (canvas past ~2000 points). Canvas keeps the full a11y fallback table + keyboard layer.
visualMapVisualMapOptionsMap each point’s y → CVD-safe colour and/or size via a keyboard-operable legend that filters the visible range.
toolboxboolean | ToolboxOptionsRender a keyboard-reachable toolbox — PNG/SVG export, a data-view table toggle, and restore (reset the visualMap filter).

Design tokens

When to use

When not to use

Examples

Basic scatter chart

import { ScatterChart } from '@cascivo/charts'

const series = [{ id: 'a', label: 'Group A', data: [{x:1,y:2},{x:3,y:4}] }]
<ScatterChart series={series} title="Scatter" />

Related components

← Back to docs