reactchartjs / react-chartjs-2

React components for Chart.js, the most popular charting library
https://react-chartjs-2.js.org
MIT License
6.64k stars 2.37k forks source link

[Bug]: Background color for chart is not working #1201

Open altimetrik-dtavandikar opened 1 year ago

altimetrik-dtavandikar commented 1 year ago

Would you like to work on a fix?

Current and expected behavior

I want to set background color to specific chart portion based on event in graph data. When there is error I want to display red background, when there is warning I want to display yellow background.

But static background also not working.

I have tried beforeDatasetsDraw method from plugin to render background but its not working, I have added console in the same method but nothing in console as well, looks like method is not invoking.

I have tried beforeDatasetsDraw method inside filler as well, there also not working.

Reproduction

https://github.com/altimetrik-dtavandikar/chartjs.git

chart.js version

4.4.0

react-chartjs-2 version

5.2.0

Possible solution

No response