BilldaCat
Posts: 11
Joined: Fri Jun 24, 2022 6:46 pm

Snap navigator to points?

We're graphing quarterly data in a stacked area chart -- when the user adjusts the visible part through the navigator, we'd like them to only be able to land on the quarterly points, not days or months in between them. Is that possible? Been doing some searching around and haven't found anything that fits my use case so far.

Thanks!
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Snap navigator to points?

Hi BilldaCat!
Thanks for contacting us with your question!

I am not sure if I understand you correctly, but you can use a setExtremes callback function from xAxis events. There, if you have some intervals between points you can check the interval, which includes an actual minimal value from the navigator. Then, set proper extremes from that interval using xAxis.setExtremes method.

Demo: http://jsfiddle.net/BlackLabel/tqscwr3m/
API Reference: https://api.highcharts.com/highstock/xA ... etExtremes
https://api.highcharts.com/class-refere ... etExtremes

Let me know if that was what you were looking for.
Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Stock”