[Chartjs]-Trying to update background color on chart.js

2👍

Since, there is no native way of changing the background color of chart in ChartJS, hence, you would have to do some css styling to accomplish so …

#myChart {
  background-color: #22293d;
}

additionally, if you want the graph­‘s fill color to match chart­‘s background color then, you need to set datasetFill property to false in your chart options …

var optionsNoAnimation = {
   datasetFill: false,
   ...
}

Here is the working demo on JSFiddle

Leave a comment