Typography
The text styles to use for chart text, from titles and axis labels to legends and data labels, and how to keep chart text readable.
This page lists the text styles to use in charts. For rules on labelling, see Labels and legends. For the colours of chart text, see Colours.
Chart text elements, numbered to match the table. For illustration only, not a recommended design.
Use the following styles as a starting point for chart text.
| Name | Typeface | Weight | Size | MDS class |
|---|---|---|---|---|
| 1. Chart title | Maersk Text | SemiBold | 18px | mds-text--large-semibold |
| 2. Chart subtitle | Maersk Text | Regular | 16px | mds-text--medium-normal |
| 3. Axis tick labels | Maersk Text | Regular | 12px | mds-text--x-small-normal |
| 4. Axis titles | Maersk Text | Regular | 14px | mds-text--small-normal |
| 5. Legend labels | Maersk Text | Regular | 12px | mds-text--x-small-normal |
| 6. Data value labels | Maersk Text | Regular | 12px | mds-text--x-small-normal |
| 7. Reference line labels | Maersk Text | Regular | 12px | mds-text--x-small-normal |
For a single value shown as text, such as a KPI or the total in the centre of a donut, use large text for the value and small text for its label.
| Name | Typeface | Weight | Size | MDS class |
|---|---|---|---|---|
| Single value, such as a KPI or donut total | Maersk Text | SemiBold | 18px | mds-text--large-semibold |
| Label for a single value | Maersk Text | Regular | 14px | mds-text--small-normal |
The classes set the typeface, weight and size from design tokens. A chart drawn by a charting library can’t use the classes, so set the same size and weight in its options.
Use the charting library’s default styling for tooltips.
For guidance on when to use a chart title or subtitle, see Give the chart a clear purpose in Core principles.
Keep chart text readable
- Use sentence case for all chart text.
- Treat the sizes above as a base recommendation. In a dense layout, such as a dashboard, they may not fit and you may need to adapt them. Shorten text or show fewer labels before you make text smaller.
- Allow enough room for longer labels and translations without breaking the chart layout.