Data series
Use these rules for data series represented by filled shapes, such as bars, slices, stacked segments and areas.
Fill colours
For each series, use the background token of its assigned Extended palette as the fill. Give “Other” the strongest Neutral background colour. See Colours for the palettes, their order and the token values.
Use solid colours
Use solid fills for bars, slices, stacked segments and other filled shapes, not gradients. The exceptions are filled areas, which use transparency, and patterns, which supplement a solid colour.
Use transparency for filled areas
For filled areas, such as in area or radar charts, use transparent fills. Overlapping areas then stay visible, and every area chart looks the same whether or not its areas overlap. Use a solid outline to keep the boundary of each series clear.
Set area fills to 20% opacity and keep the outline solid. Use the border token of the same Extended palette for the outline, and the background token for the fill. This includes stacked areas.
Bubbles in a bubble chart follow the same rule: a 20% fill with a 1px outline in the border token of the same palette, so overlapping bubbles stay visible.
Keep filled shapes borderless
Filled shapes don’t need an outline. Leave borders off by default so the colours and shapes carry the data. The exception is filled areas, which need an outline.
Separate neighbouring filled shapes when needed
Use a 2px gap in the background colour when neighbouring filled shapes would otherwise be difficult to distinguish, such as when adjacent colours are similar. 2px is the line width MDS recommends. Don’t add a border around every shape just to create separation.
Consider patterns when they improve readability
Patterns or decals can provide an additional way to distinguish filled series when colour alone is not enough. Use them only when they improve readability and your charting library supports them. Patterns should supplement the series colours rather than replace them.
MDS does not provide or prescribe a set of patterns. Keep any patterns simple and use them consistently within the chart.
Patterns help some people, such as those with colour vision deficiency, tell series apart, but they can add visual noise for others. Consider offering a switch so people can turn patterns on or off.
To add patterns, see the ECharts guide to aria and decal patterns and the Chart.js documentation on patterns and gradients.