Skip to main content

ScatterPlot

Two measures against each other, with optional median-split quadrants.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Two measures against each other, with optional median-split quadrants.

Accessibility​

Each chart ships an accessible fallback (a visually-hidden data table / aria-label summary) so the data is available to screen readers, not just sighted users. Colour is paired with shape/label, never used alone.

Install and import​

npx shadcn@latest add @prism/scatter-plot
import { ScatterPlot } from '@/components/prism/ScatterPlot';

In a no-build prototype, read it from the bundle instead: const { ScatterPlot } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
pointsScatterPoint[]Yes
xLabelstring—
yLabelstring—
heightnumber—
quadrantsScatterQuadrants—Quadrant names. Use NOUNS naming what falls there, never "high/high".
xDividernumber—Divider positions. Default: the medians, which always split the population in half.
yDividernumber—
formatX(value: number) => React.ReactNode—
formatY(value: number) => React.ReactNode—
sizeKeystring—Point key whose value scales the dot AREA (a bubble chart).
captionstring—
classNamestring—