Charts created with Chart.js are born responsive and fit nicely into your screen, but they are also born gray. In this section, you will discover how to change some style properties.
Configuring colors, fonts, and responsiveness
Dataset configuration for bar charts
Besides the data and label properties, each dataset object can contain a number of optional configuration properties. Most of them are used to configure fill and border colors and widths. They are briefly described in the following table:
Property |
Value |
Description |
data |
Number[] |
An array of numbers containing the data to display (this is mandatory) |
label |
String |
A label for the dataset |
backgroundColor |
String or String[] |
The fill color... |