fat_potato
fat_potato

Reputation: 653

how to highlight a specific area on chartjs line chart

I am using chartjs to draw a line chart on my application. I have dates onx-axis but as a category scale. Means labels are strings but are dates. On the y-axis i have numeric values. I am changing the chart on some functionality and after change i want to highlight some area of the chart. Is there any way i can highlight an area on the line chart? I have searched but did not find anything.

I want to do this pragmatically like there are some specific dates which i want to highlight so i want to have this type of effect.

enter image description here Any kind of help would be much appreciated. I am very beginner in charts and javascript stuff.

P.S this is specifically for the line chart not for the doughnut

Upvotes: 1

Views: 7163

Answers (1)

Janaka Pushpakumara
Janaka Pushpakumara

Reputation: 5107

I use this https://github.com/chartjs/chartjs-plugin-annotation lib to do something like this.check on it. I think this will helpful.

Upvotes: 3

Related Questions