Options configuration
Defaults are configured per chart with an options configuration object included in the chart
object (the second parameter of the constructor), as demonstrated in the following block of code:
new Chart("ocean-volume-bar-chart", { type: "bar", data: dataObj, options: {} // configure options here });
There are many defaults that you can change. You might, for example, wish to have more control over the size of your chart, which resizes automatically. That happens because charts are responsive by default. You can turn responsiveness off by overriding the responsive
property, which has a default true
 value, as follows:
options: { responsive: false }
Now, your chart no longer resizes automatically. However, what if you do want to undertake resizing, but don't care about the aspect ratio? Then, you can override the maintainAspectRatio
property, as follows:
options: { maintainAspectRatio: false }
You might want this if your...