reactchartjs/react-chartjs-2

[Bug]: Background color for chart is not working

altimetrik-dtavandikar opened this issue · 0 comments

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

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