App components / Charts
Bar chart
Compare values across categories or months. One series is grey with one bar in the accent; several series stack or sit side by side as parts of a total; a line adds a rate on its own axis on the right.
MembersReact · Vue · HTMLFigma: Charts
Code
The component itself, ready to drop into your project. Switch between React, Vue and plain HTML; every version uses the same Tailwind classes on Ochre's tokens.
| Revenue | |
|---|---|
| Jan | £18,200 |
| Feb | £22,100 |
| Mar | £19,300 |
| Apr | £26,400 |
| May | £24,100 |
| Jun | £29,300 |
| Jul | £31,200 |
| Aug | £27,200 |
| Sep | £33,400 |
| Oct | £36,500 |
| Nov | £30,100 |
| Dec | £38,200 |
Installation
Examples
Stacked bars
Three plans per month, stacked or grouped.
| Team | Business | Free | |
|---|---|---|---|
| Jan | £12,000 | £8,000 | £4,000 |
| Feb | £14,000 | £9,000 | £5,000 |
| Mar | £13,000 | £10,000 | £4,000 |
| Apr | £16,000 | £9,000 | £6,000 |
| May | £15,000 | £11,000 | £5,000 |
| Jun | £18,000 | £12,000 | £6,000 |
| Jul | £20,000 | £11,000 | £7,000 |
| Aug | £19,000 | £13,000 | £6,000 |
| Sep | £22,000 | £12,000 | £8,000 |
| Oct | £24,000 | £14,000 | £7,000 |
| Nov | £21,000 | £15,000 | £8,000 |
| Dec | £26,000 | £16,000 | £9,000 |
- Team
- Business
- Free
Bars and line
Orders as bars, conversion as a line on the right axis.
| Orders | Conversion | |
|---|---|---|
| Jan | 18,000 | 2.1% |
| Feb | 22,000 | 2.4% |
| Mar | 19,000 | 2.2% |
| Apr | 26,000 | 2.9% |
| May | 24,000 | 2.7% |
| Jun | 29,000 | 3.1% |
| Jul | 31,000 | 3.4% |
| Aug | 27,000 | 3.0% |
| Sep | 33,000 | 3.6% |
| Oct | 36,000 | 3.9% |
| Nov | 30,000 | 3.3% |
| Dec | 38,000 | 4.3% |
- Orders
- Conversion
Motion
Built on Ochre's ease-out curves. With reduced motion switched on, everything still works, it just doesn't move.
01Bars grow from the baseline with a slower ease-out, a column at a time from the left.
02The rate line draws itself once, then its points pop in.
03New data glides every bar and point to its new height with a slower ease-out.
04The tooltip follows the pointer from column to column; the hovered column gets a quiet band.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | – | What the chart shows. Names the chart for screen readers and captions its data table. |
| categories | string[] | – | One label per column, in order: Jan, Feb, Mar. |
| series | { name; values; series? }[] | – | One series for a bar chart, several for stacked or grouped bars. series picks the colour (1 is the accent). |
| layout | "stacked" | "grouped" | "stacked" | With several series: stacked to read totals, grouped to compare parts. |
| highlight | number | null | last | One series: the column drawn in the accent. null draws every bar grey. |
| line | { name; values; max?; prefix?; suffix?; decimals? } | – | A rate over the bars, with its own axis on the right (Bars and line). |
| prefix · suffix · decimals | string · string · number | – | How values read in the tooltip: £18,240 or 4.2%. |
| height | number | 240 | Height in pixels. The width follows the container. |
| legend | boolean | several series | Shows a legend under the chart. |
Usage
Use it for
- Monthly totals where one month matters: this month, the best month, the month in question.
- Parts of a total per period: stacked to read the total, grouped to compare the parts.
- A volume and a rate together, such as orders and conversion.
Avoid
- More than three stacked series: the greys stop being tellable apart. Use a table.
- Colouring a falling month red. Every bar but the one that matters stays grey.
- A line for categories that have no order; bars and line is for time.