Overview Button Copy button Field Input Number field Textarea Select Combobox Multiselect Date picker Date range picker Date-time picker Checkbox Radio group Position picker Switch Slider Dropzone Device controls Avatar Badge Card Collapsible Kbd Map Matrix Proportion bar Separator Stat Table Timeline Chat Playback Pagination Charts Chart theming Profile chart Time series chart Bar chart Isopleth chart TS diagram Box plot Rose chart Calendar chart Banner Toast Loader Progress Skeleton Empty state Error state Dropdown menu Tooltip Info tooltip Dialog Sheet Resizable Confirm dialog Breadcrumbs Command palette Mobile menu Navigation list Outline Scroll rail Sidebar Tabs
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.