Charts
Charts are drawn with TanStack Charts, the engine both products already use through Nitti’s chart package. The design system gives it one look: the colours, the guides, the labels and the motion come from the tokens, so a chart follows the brand and the theme chosen at the top of the page without any code of its own. They are grouped here by the question a reader brings.
Comparing amounts
Bars in their forms, for amounts set against each other. Each is one call from lib/chart, drawn by Chart inside a ChartFigure. Point at one for its values.
- Supports
- With conditions
- Opposes
- Supports
- With conditions
- Opposes
- Supports
- With conditions
- Opposes
- Opposes
- With conditions
- Supports
- 2019
- 2025
- Regional grid association of the northern counties34
- Municipal federation, committee on energy and land27
- Environmental agency, species protection unit19
- Industry energy council12
- Landowners' association8
Change over time
Lines and areas for one thing followed through time, and a reference line for the value it is held against.
- Grid connections
- All energy permits
- Supports
- With conditions
- Opposes
- Months to a decision
- The bill's limit: 12 months
Parts of a whole
One total and what it is made of: a donut for a few parts, a waffle when the whole can be counted, a share bar on one line, a treemap for many parts in groups.
- Supports
- With conditions
- Opposes
- Supports
- With conditions
- Opposes
- Yes18754%
- No14241%
- Abstained82%
- Absent123%
- North
- South
- Mid
- Capital
Relationships and spread
Two measures together, where something concentrates, and how one number is spread.
- 1Energy producers
- 2Grid association
- 3Industry council
- 4Municipal federation
- 5Environmental agency
- 6Landowners
- 7Nature society
- 8Rural network
- 9Consumers' forum
- 10Transport union
- Permits
- The bill's limit: 12 months
Flows
Amounts on the move between states.
Numbers to watch
For a widget or the top of a report: the number, how it has moved, and a sparkline of the road there. The colour of the change says whether it is welcome, not which way it went.
Which chart
Start from the question the reader has, not from the data's shape.
| How do a few amounts compare? | Bars | barChart, labels on one series |
| Which are the biggest, in order? | Horizontal bars, or a bar list | barChart horizontal with sorted rows; BarList when names are long or the place is narrow |
| How do groups compare, part by part? | Grouped bars | barChart with series |
| The same, when each group's total matters | Stacked bars | barChart, layout "stacked" |
| How does the mix differ between groups of different size? | Share bars | barChart, layout "share" |
| Which way does each group lean on an ordered scale? | Diverging bars | divergingChart, centred on the neutral answer |
| How far apart are two values, row by row? | A range | rangeChart: before and after, low and high |
| How has it changed over time? | Lines | lineChart |
| The same, for one series where volume matters | An area | lineChart with area |
| How is a changing total made up? | A stacked area | lineChart, area "stacked" |
| Is it above or below a target? | A reference line | reference on barChart or lineChart, named in the legend |
| What is the number now, and where is it heading? | A stat with a sparkline | ChartStat, Sparkline |
| How is one whole divided, in five parts or fewer? | A donut, or a share bar | donutChart with ChartCenter; ShareBar where there is one line to spare |
| The same, when the whole is small enough to count | A waffle | waffleChart |
| How is a whole divided into many parts, in groups? | A treemap | treemapChart |
| Do two measures move together? Which things stand apart? | A scatter | scatterChart, with size for a third measure |
| Where does each thing sit on two scales that call for action? | A map in four corners | scatterChart with quadrant and names, and a ChartKey under it |
| Where does something concentrate across two categories? | A heatmap | heatmapChart |
| How is one number spread? | A histogram | histogramChart |
| Where did the amounts go, from one state to another? | A flow | flowChart |
| Exact numbers, or more than about twenty rows | A table | No chart: Table, or DocumentTable in a document |
Colours
Two sets, never mixed for the same thing.
Series
Categories that are neither good nor bad: kinds, regions, products. The brand's accent is first; the order is fixed. The first has a second tone for lines and dots, which have no area to be seen by: the same colour in Nitti, a deeper one on Polyther's light pages (--chart-1-line; the legend below draws its line and its point in it).
Meaning
When the category is a judgement: for or against, yes or no, better or worse. The same in both brands, and always named in a legend as well.
- A bar or an area
- A line
- A point
- An earlier value
- A reference line
The look
What every chart shares. lib/chart-base holds these values (chartTheme, chartAxis, chartGrid, chartMotion, chartReference) for a chart built by hand.
| Colour | Series colours for categories that are neither good nor bad, in a fixed order with the brand's accent first. Meaning colours when the category is a judgement. One thing keeps one colour in every chart of a document. A sixth series means a different chart, or an Other in the neutral. |
| Guides | Horizontal grid lines only, 1 px at 9% of the text colour. No axis line, no tick stubs, no frame around the plot. A reference line is dashed, in the text colour, and named in the legend. |
| Labels | 11 px, muted, tabular figures. The value axis has about four ticks. A single series prints its values on the bars and drops the axis. Axes get a title only where the unit is not obvious (a scatter). |
| Marks | Bars carry a 4 px radius on the end that shows the value. Lines are 2 px and monotone, with points while there are sixteen or fewer per series. An area is its line over a 14% fill. Dots sit on a ring of the background so they separate where they overlap. |
| Narrow screens | A chart fits the width it gets, down to 320 px, with nothing to set. Names along the bottom sit side by side, go on a slant when they no longer fit, and are thinned only as a last resort. Names down the side are cut with an ellipsis so the bars keep their room; the tooltip has them in full. Line charts label as many points as fit, evenly spaced. A scatter that cannot fit its names numbers the dots and lists the names underneath (ChartKey). |
| Tooltip | A popover surface: what is pointed at, then a row per series with its colour and value. Bars and lines read every series at the pointed position. On a phone a tap opens it, a tap outside or a scroll lets it go, and a finger moving sideways reads along the chart. Sparklines and the HTML charts have none: their numbers are printed. |
| Motion | One entrance when the chart is first scrolled into view: 480 ms, bars staggered. Keyed updates glide to their new values. Nothing moves under reduced motion. Sparklines do not animate. |
| Around the chart | ChartFigure: a title that says what the chart shows, one line on how to read it, the legend as text, and the source underneath. The legend is HTML, never drawn in the plot, and draws each entry the way the chart does (a square, a line, a dot, a dash). |
| Access | Every chart has an ariaLabel that says what it shows. Points take keyboard focus. Colour is never the only carrier: parts are named in the legend and the tooltip, and exact values are in the text, on the marks or in a table nearby. |