Skip to content
Advertisement

Chart area background color chartjs

I have problem with chart js, i want to coloring chart area like image above enter image description here

I try to find configuration from charJs Docs , but nothing matched. its possible or not to change chart area background color? if possible anyone can help me?

Html

JavaScript

Javascript

JavaScript

Here’s my current code jsFiddle

so everyone can try for find solution. thanks for your help.

Advertisement

Answer

There is no built-in method to change background color, but you can use CSS. JSFiddle.

JavaScript

EDIT

If you want to fill exact area of chart and no whole div, you can write your own chart.js plugin. Try it on JSFiddle.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement