artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Zoom from function

Hey again :mrgreen: Long time no see :D

I have two questions this time :)
1. Is it possible to zoom a chart from function? (I would like to make a sliders outside the chart to work something like navigator)
2. Is there some option not to show series where there are no point in zoomed fragment? (ex. I have two employees on chart, first one is working 5-13, and second is working 14-22 and i would like to make something that when i zoom chart at 4:30-13:30 the second employee will get "visible=false" flag on chart :) )

Thanks in advance :)
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Zoom from function

Hi,
Thanks for contacting us again!

1. If you use setExtremes, you will be able to define ranges as in the navigator, in this case the functions are attached to the buttons, is that what you mean?viewtopic.php?t=42675#p150307
https://api.highcharts.com/gantt/xAxis. ... etExtremes
https://jsfiddle.net/BlackLabel/j36abp08

2. Could you show me this in a simplified version?

Best regards.
Sebastian Hajdus
Highcharts Developer
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: Zoom from function

sebastian.h wrote: Fri Apr 16, 2021 8:33 am Hi,
Thanks for contacting us again!

1. If you use setExtremes, you will be able to define ranges as in the navigator, in this case the functions are attached to the buttons, is that what you mean?viewtopic.php?t=42675#p150307
https://api.highcharts.com/gantt/xAxis. ... etExtremes
https://jsfiddle.net/BlackLabel/j36abp08
Yeah, thats it :)
sebastian.h wrote: Fri Apr 16, 2021 8:33 am 2. Could you show me this in a simplified version?
Like here: https://jsfiddle.net/x4fvepsj/
When you choose 2021 second serie is empty (has no points) in this range, so I would like for it not to show (and first serie for 2028)
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Zoom from function

Hi,
Thanks for the example and explanation, now it's clear.

The best solution seems to me is to delete the series if it is not visible, then update and load all series if it is visible.
What do you think about this?

Best regards.
Sebastian Hajdus
Highcharts Developer
artakserkses
Posts: 51
Joined: Tue Feb 23, 2021 11:23 am

Re: Zoom from function

sebastian.h wrote: Tue Apr 20, 2021 3:47 pm Hi,
Thanks for the example and explanation, now it's clear.

The best solution seems to me is to delete the series if it is not visible, then update and load all series if it is visible.
What do you think about this?

Best regards.
Yeah, I tried that :) To have one seriesArray with all series, and build array of "visible" series and categories for those series, but ... it is quite problematic and slow.
So I think, that the best option (for now) for me will be to show all series, and in background download data for selected time, and all the computing made on the server side (and update after getting all data). It will be as slow as the first option, but it will be less problematic, cause I wouldn't have to keep series in seperate array, and keep track on moving points between series (cause now I have bazilion issues with moving points (drag/drop, click, etc) and other cloudy things :) )
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Zoom from function

Hi,
Unfortunately, I don't know a faster solution, but the idea to do it on the server side seems pretty good.

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Gantt”