Skip to content
peakcharts

LollipopChart

A lighter bar chart: a stem and a dot per category.

Tickets closed by agent
Tickets closed by agentClick a mark to pin its value; click it again to release. Keyboard: Enter or Space to pin, Escape to release. Data table below.012243648MaraDevinYukiTomasPriyaMara: 48Devin: 41Yuki: 37Tomas: 29Priya: 22
Click a mark to pin its value
View data
Tickets closed by agent
LabelValue
Mara48
Devin41
Yuki37
Tomas29
Priya22
<LollipopChart title="Tickets closed by agent" data={data} />

Usage

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

const data = [
  { label: 'Mara', value: 48 },
  { label: 'Devin', value: 41 },
  { label: 'Yuki', value: 37 },
  { label: 'Tomas', value: 29 },
  { label: 'Priya', value: 22 },
];

export default function Example() {
  return <LollipopChart title="Tickets closed by agent" data={data} />;
}

Data

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

  • Reads well when many values are close together.

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