Abrissirba
Posts: 11
Joined: Mon Mar 27, 2017 11:30 am

Marking zones with areas on x-axis

Hi,

I have a scenario where I would like to mark timespans in a linegraph with a shadowed area, Like the picture but with a an opacity on the areas.
attachment
filtered-timespan.png
filtered-timespan.png (15.23 KiB) Viewed 1325 times

The marked areas are used to distinguish periods of time that has been marked as bad.

One option is to use this example, http://jsfiddle.net/gh/get/jquery/2/hig ... oneaxis-x/, but that doesn't work very well if you set lineWidth to 0 (only showing the points).

Is there a way to to something like the example?
bastss
Site Admin
Posts: 1200
Joined: Wed Oct 17, 2018 10:59 am

Re: Marking zones with areas on x-axis

Hi Abrissirba,

Something like this is what you wanted?
https://jsfiddle.net/BlackLabel/75doz1xw/
Inside plotBands you can set required effect by manipulate zIndex and color.

API: https://api.highcharts.com/highcharts/xAxis.plotBands

Best regards
Sebastian Wędzel,
Highcharts Developer
Abrissirba
Posts: 11
Joined: Mon Mar 27, 2017 11:30 am

Re: Marking zones with areas on x-axis

That was exactly what I wanted!

Thanks :)
bastss
Site Admin
Posts: 1200
Joined: Wed Oct 17, 2018 10:59 am

Re: Marking zones with areas on x-axis

You're welcome :)
Sebastian Wędzel,
Highcharts Developer

Return to “Highcharts Usage”