ScatterChart

Bubbles spring up on a tidy grid. Point at one and it swells, guides run to both axes, and a card reads out the values. Charts.

Open playground
Score
Study

About

ScatterChart is a React component in the Charts category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ScatterChart } from "@ashutoshswamy/smoui" and set data, xLabel, xSuffix.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ScatterChart } from "@ashutoshswamy/smoui";

<ScatterChart xLabel="Hours" yLabel="Score" data={[{ label: "Ada", x: 4, y: 62, size: 3 }, { label: "Bo", x: 9, y: 78, size: 8 }]} />

Props 3

data

Points. `size` scales the bubble.

{ label; x; y; size? }[]
xLabel / yLabel

Axis captions.

string
xSuffix / ySuffix

Unit on ticks and values, e.g. "%".

string