Skip to content

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

Open
@altimetrik-dtavandikar

Description

@altimetrik-dtavandikar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions