Data series
Use these rules for any series drawn as a line, such as in a line chart or as the outline of an area, and for the markers on its points.
Line colours
For each series, use the border token of its assigned Extended palette as the line colour. See Colours for the palettes, their order and the token values.
Use a 2px stroke
Draw data lines with a 2px stroke. This is the line width MDS has designed for charts and recommends. Use it for every line, so thickness doesn’t suggest that one series matters more than another.
Use straight lines, not curves
Join data points with straight segments. A smoothed curve suggests values between the points that were never measured and can overshoot the real highs and lows.
Use solid lines for measured data
Use solid lines for measured data and dashed lines for forecasts or projections. Keep both in the series colour.
Use neutral dashed lines for references, and shaded areas and labels for context, such as a target or a forecast period. See Annotations.
Break the line where data is missing
Leave a gap where there is no data. Don’t join across the gap or drop the line or area to zero, because both show values that were never measured.
Don’t use “Other” on line charts
Combining several series into an “Other” line can create a value that is difficult to interpret. Instead, keep the series separate, each in its own colour, or split them across charts.
Show markers when individual points matter
Use markers when there are relatively few data points or when people need to see where individual values were recorded.
Leave markers out when data is dense and the markers would touch or overlap and obscure the line. When markers are used, colour every marker the same as the line it represents.
When a single series uses markers, use a filled circle. Use the charting library’s default marker size unless there is a reason to adjust it.
Use distinct marker shapes for multiple series
Markers are optional, but when several series use them, give each series a different shape. Shape gives people a second way to tell series apart, so colour isn’t the only cue. Use up to six shapes, in the order below. If more than six series are needed, reconsider how the data is presented (see Data series) rather than repeating marker shapes.
MDS does not provide marker shapes. If you use ECharts, use its built-in line markers in the order below. See the ECharts documentation on line series symbols. Chart.js also has built-in point styles, described in its point styling example.
| Data series | Shape | ECharts symbol |
|---|---|---|
| 1st | Circle | circle |
| 2nd | Triangle | triangle |
| 3rd | Square | rect |
| 4th | Diamond | diamond |
| 5th | Empty circle | emptyCircle |
| 6th | Rounded square | roundRect |
This order prioritises visually distinct shapes and keeps similar shapes, such as circle and empty circle, apart.