Ballmac UI home

Chart Scatter

A scatter or bubble chart with grouped colors, point sizes from a third number and titled axes, in a frame with a toggling legend, a table of every point with CSV download, and states.

6/6 checksv1.0.0Updated Oct 18, 2026
What changed

Price and rating

Ten headphones

10 points. Price from 29 to 95; Rating from 3.9 to 4.9.

Installation

$ pnpm dlx shadcn@latest add @ballmac/chart-scatter

Usage

import { ChartScatter } from "@/components/ballmac/chart-scatter"

The full example is in the Code tab above.

Examples

Groups by color

Usage by seats

One point per account, colored by plan

15 points. Seats from 1 to 42; Requests per day from 90 to 5,100.

Bubbles sized by a third number

Cities

Size shows economic output

11 points. People (millions) from 3.7 to 23.2; Growth (%) from 0.1 to 3.6.

API reference

PropTypeDefault
data*

One row per point: a number under `xKey` and one under `yKey`, optionally a size, a group and a name.

ChartRow[]—
xKey*string—
yKey*string—
zKey

The key of a number that sets each point's size, which turns the scatter into a bubble chart.

string—
groupKey

The key that says which group a point belongs to. Each group gets a color and a legend item.

string—
groups

Names and colors for the groups. Without it every point is one group.

ChartSeries[]—
nameKey

The key of each point's name, shown in the tooltip and the table.

string—
xLabel*

Axis titles, also used in the tooltip and the table.

string—
yLabel*string—
zLabelstring—
xFormatter(value: number) => string—
yFormatter(value: number) => string—
xDomain[number | "auto", number | "auto"]—
yDomain[number | "auto", number | "auto"]—
sizeRange

Smallest and largest point size in pixels, when `zKey` is set.

[number, number][80, 520]
grid"both" | "horizontal" | "none""both"
tooltipbooleantrue

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Arrow keysMove between points (accessibilityLayer)
Tab, Enter / SpaceLegend buttons switch series off and on; the Chart / Table switch shows the numbers as a table
Screen readersThe figure has a name and a summary written from the data
TableEvery point, with its name, group and values, in a table you can download as CSV

Quality scorecard

6/6

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 3 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    No endless animation to begin with.

  • Not applicable: Right to left

    Not mirrored by design: Recharts draws its axes in SVG coordinates, which do not mirror.

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    13 tab stops, each showing a visible change when it takes focus. 4 documented keys.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • Passed: Automated tests

    Covered by charts-batch-families.test.tsx.

  • For information: Footprint

    2.9 KB of source (gzip) in 1 file. Installs recharts.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

<ChartScatter title description data xKey yKey xLabel yLabel /> with optional zKey (point size), groupKey plus groups ([{ key, label, color? }]), nameKey, xDomain, yDomain, sizeRange, formatters, legend, patterns, state. Every row is one point. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Chart Scatter (@ballmac/chart-scatter) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Relationships between two numbers
  • Distributions and outliers
  • Bubble charts with a third measure

Not for

  • Trends over time (use chart-line)
  • Categories with one value each (use chart-bar)

Registry JSON: https://ui.ballmac.com/r/chart-scatter.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.