Aller au contenu principal

ScatterPlot

Every example on this page is live, drawn by the library's Storybook, where you can also change its props and see the result.

A scatter plot with optional X/Y axes and labels. Points are rendered as filled circles, each axis spanning its points from the lowest value to the highest. A visible axis is ticked at round values that fit its length, so every label sits at the value it names. The plot stretches to fill its box while the dots and labels keep their size.

Import​

import { ScatterPlot } from "~lib/charts/scatter-plot";

Props​

NameTypeRequiredDefaultDescription
data{ x: number; y: number }[]YesN/AData points
axis{ x?: { name?: string; visible?: boolean }; y?: { name?: string; visible?: boolean } }NoN/AAxis configuration (labels and visibility)
widthnumber | stringNo300Chart width
heightnumber | stringNo300Chart height

Examples​

Simple​

Ouvrir Simple dans Storybook

With Axes​

Ouvrir With Axes dans Storybook

Negative Coordinates​

Ouvrir Negative Coordinates dans Storybook

Large Dataset​

Ouvrir Large Dataset dans Storybook

See Also​