Skip to content
peakcharts

StepChart

For values that hold steady and then jump.

Seats provisioned
Seats provisionedClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.06.51319.526JanFebMarAprMayJunJulJan: 12Feb: 12Mar: 18Apr: 18May: 18Jun: 26Jul: 26
Click a mark to pin its value
View data
Seats provisioned
LabelValue
Jan12
Feb12
Mar18
Apr18
May18
Jun26
Jul26
<StepChart title="Seats provisioned" data={data} />

Usage

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

const data = [
  { label: 'Jan', value: 12 },
  { label: 'Feb', value: 12 },
  { label: 'Mar', value: 18 },
  { label: 'Apr', value: 18 },
  { label: 'May', value: 18 },
  { label: 'Jun', value: 26 },
  { label: 'Jul', value: 26 },
];

export default function Example() {
  return <StepChart title="Seats provisioned" data={data} />;
}

Data

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

  • Good for plans, limits and anything that changes at discrete moments.

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