Bar chart

Amounts by category, side by side or stacked: samples per month, hours per vessel.

Playground

Samples taken per month, by waypoint. Kvamsøy wasn't visited in December.

Medium

Horizontal

Hours this year per vessel, by what they were doing.

Usage

<BarChart
	categories={['Jan', 'Feb', 'Mar']}
	series={[
		{ key: 'hf-1', label: 'HF-1', values: [4, 4, 6] },
		{ key: 'hf-2', label: 'HF-2', values: [4, 4, 6] },
	]}
	valueLabel="Samples"
	stacked
/>

Rules

  • Bars start at zero, always: a bar is read by its length, and a cut axis makes 52 look twice 48.
  • Stack parts of a whole (samples per station adding up to the month). Put side by side what is compared with each other.
  • Horizontal for long category names or many categories: names read across, not tilted.
  • Square bars, a hairline between stacked parts, no gradients or shadows.
  • In print, where nothing can be hovered, put the values on the bars when the exact number matters.
  • A missing value is no bar, not a zero bar.