Skip to content
peakcharts

AreaChart

A line with the volume underneath it filled in.

Daily visits
Daily visitsClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.0302.5605907.51.2KMonTueWedThuFriSatSunMon: 820Tue: 934Wed: 1,102Thu: 987Fri: 1,210Sat: 640Sun: 575
Click a mark to pin its value
View data
Daily visits
LabelValue
Mon820
Tue934
Wed1,102
Thu987
Fri1,210
Sat640
Sun575
<AreaChart title="Daily visits" data={data} />

Usage

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

const data = [
  { label: 'Mon', value: 820 },
  { label: 'Tue', value: 934 },
  { label: 'Wed', value: 1102 },
  { label: 'Thu', value: 987 },
  { label: 'Fri', value: 1210 },
  { label: 'Sat', value: 640 },
  { label: 'Sun', value: 575 },
];

export default function Example() {
  return <AreaChart title="Daily visits" data={data} />;
}

Data

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

  • There is no stacking. Each chart draws a single series.

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