Skip to content
peakcharts

ScatterChart

Two measures per item, to spot clusters and outliers.

Price against rating
Price against ratingClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.01.22.43.64.81223344556Starter: 3.8 (x: 12)Basic: 4.1 (x: 18)Plus: 3.9 (x: 24)Pro: 4.4 (x: 29)Team: 4.2 (x: 35)Studio: 4.6 (x: 41)Scale: 4.5 (x: 48)Enterprise: 4.8 (x: 56)Legacy: 3.4 (x: 21)
Click a mark to pin its value
View data
Price against rating
PointXY
Starter123.8
Basic184.1
Plus243.9
Pro294.4
Team354.2
Studio414.6
Scale484.5
Enterprise564.8
Legacy213.4
<ScatterChart title="Price against rating" data={data} />

Usage

ScatterChart.tsx
import { ScatterChart } from 'peakcharts';
import 'peakcharts/styles.css';

const data = [
  { x: 12, y: 3.8, label: 'Starter' },
  { x: 18, y: 4.1, label: 'Basic' },
  { x: 24, y: 3.9, label: 'Plus' },
  { x: 29, y: 4.4, label: 'Pro' },
  { x: 35, y: 4.2, label: 'Team' },
  { x: 41, y: 4.6, label: 'Studio' },
  { x: 48, y: 4.5, label: 'Scale' },
  { x: 56, y: 4.8, label: 'Enterprise' },
  { x: 21, y: 3.4, label: 'Legacy' },
];

export default function Example() {
  return <ScatterChart title="Price against rating" data={data} />;
}

Data

data takes { x: number; y: number; label?: string }[]. Input arrays are never mutated and order is preserved.

  • A label is optional and shows up in captions and the data table.

Every chart also accepts the common props: description, height, color, variant, animate, formatValue and className.