Skip to content
peakcharts

LineChart

A value moving through an ordered sequence.

Weekly active users
Weekly active usersClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.0480.3960.51.4K1.9KW1W2W3W4W5W6W7W1: 1,240W2: 1,385W3: 1,362W4: 1,604W5: 1,718W6: 1,693W7: 1,921
Click a mark to pin its value
View data
Weekly active users
LabelValue
W11,240
W21,385
W31,362
W41,604
W51,718
W61,693
W71,921
<LineChart title="Weekly active users" data={data} />

Usage

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

const data = [
  { label: 'W1', value: 1240 },
  { label: 'W2', value: 1385 },
  { label: 'W3', value: 1362 },
  { label: 'W4', value: 1604 },
  { label: 'W5', value: 1718 },
  { label: 'W6', value: 1693 },
  { label: 'W7', value: 1921 },
];

export default function Example() {
  return <LineChart title="Weekly active users" data={data} />;
}

Data

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

  • Each chart draws one series on a category axis. There is no time scale yet.

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