dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Zoom level for specific rangeSelector buttons

Hi again!

Let me summarize your requirements briefly

After clicking any button from rangeSelector you want to block every other option from changing the chart view. You want to have (but disabled) navigator and scrollbar and you also want to disable panning and remove the zoom buttons, right? Could you tell me if that's all that you are looking for?

Best regards!
Dominik Chudy
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: Zoom level for specific rangeSelector buttons

Hi Dominik,
no, this is not correct.
I don't want to block any option from chart view or disable panning or remove buttons.
The requirement is one: "Set specific minimum and maximum for zoom on xAxis, after click for each rangeSelector button."
All options have to be enabled, zooming and panning possible...

Thank you

Paul
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Zoom level for specific rangeSelector buttons

Hi again!

As far as I remember you've managed to get this requirement done and after clicking each rangeSelector button the extremes are changed as you set them in afterSetExtremes event. E.g When I click the "Week" button I can see points for one year. From 23 Jul 2018 to 15 Jul 2019. What does not work in the demo below?

Demo: https://jsfiddle.net/BlackLabel/nmz1xyjk/

Best regards!
Dominik Chudy
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: Zoom level for specific rangeSelector buttons

Hi Dominik,
after I clicked to Week button it show me correctly max range for specific rangeSelector button in the chart, but when I zoom out or zoom in after, then the range is not keeping and I can zoom out/in outside of specified range(zoom max/zom/in).
I want to keep range for zoom out for Week button 12moths, so the zoom level can not be bigger as 12moths an lower as 3weeks(for example).
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Zoom level for specific rangeSelector buttons

Hi again!

Unfortunately, there's no API option to achieve what you would like.

But you can write your own functionality that will zoom in and out without crossing selected ranges. The zoom buttons are not available in HighStock, they're imported from HighMaps and you can find documentation about it over there. There are zoomIn and zoomOut events, which you can modify. E.g you can set your own extremes when the user will click the button.

API references:
https://api.highcharts.com/highmaps/mapNavigation
https://www.highcharts.com/docs/maps/map-navigation
https://api.highcharts.com/highmaps/map ... In.onclick
https://api.highcharts.com/highmaps/map ... ut.onclick

Best regards!
Dominik Chudy
Highcharts Developer
Paul Jaker
Posts: 29
Joined: Wed Apr 07, 2021 8:58 am

Re: Zoom level for specific rangeSelector buttons

Hi Dominik,
we didn't understand together.

Ok, than you so far.

Paul
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Zoom level for specific rangeSelector buttons

Hi again!

Wish you the best with your project and in case of any further questions feel free to reach out any time. :)

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Stock”