Skip to content
peakcharts

BubbleChart

A scatter plot where a third measure sets the size.

Markets by revenue and growth
Markets by revenue and growthClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.047.911.915.82237.55368.584Nordics: 8.5 (x: 42), size: 1,200DACH: 5.1 (x: 68), size: 3,100Iberia: 12.4 (x: 31), size: 640UK: 3.2 (x: 84), size: 4,800Baltics: 15.8 (x: 22), size: 380
Click a mark to pin its value
View data
Markets by revenue and growth
PointXYSize
Nordics428.51,200
DACH685.13,100
Iberia3112.4640
UK843.24,800
Baltics2215.8380
<BubbleChart title="Markets by revenue and growth" data={data} />

Usage

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

const data = [
  { x: 42, y: 8.5, size: 1200, label: 'Nordics' },
  { x: 68, y: 5.1, size: 3100, label: 'DACH' },
  { x: 31, y: 12.4, size: 640, label: 'Iberia' },
  { x: 84, y: 3.2, size: 4800, label: 'UK' },
  { x: 22, y: 15.8, size: 380, label: 'Baltics' },
];

export default function Example() {
  return <BubbleChart title="Markets by revenue and growth" data={data} />;
}

Data

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

  • size must not be negative.

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