Virag
Posts: 1
Joined: Wed Aug 10, 2022 4:38 pm

Conditionally render grid background color

Is there a way to conditionally render grid background color?

I have a requirement where 0-200 range should have different background color and 200-600 range should have different background color.

I wanted to acheive with box plot chart.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Conditionally render grid background color

Hi Virag!
Welcome to our forum and thanks for contacting us with your question!

You can achieve the look you requested by using plotBands on the proper axis. If I understand you correctly, you should use it on yAxis, just like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/2gk8xnsy/
API Reference: https://api.highcharts.com/highcharts/xAxis.plotBands

Feel free to ask any further questions!
Best regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”