Color schemes and palettes

Chart.js does not include a native color palette generator. In our examples so far, we have either assigned explicit colors, created color palettes with no more than six colors, or used random color-generator functions. But colors are an important means of communicating information in a chart, and should be chosen carefully. If not used with care, your chart may suggest nonexistent relationships among data, deceiving the viewer. Colors that vary in lightness and saturation suggest a sequential relationship (stronger/weaker or hotter/colder). Opposing data can be better represented using divergent color palettes, where extremes are represented by complementary colors. If your data represents different categories, ...

Get Learn Chart.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.