JayColon021
Posts: 5
Joined: Thu Dec 09, 2021 7:19 am

Zoom no longer automatically shows x-axis Weeks/Days

Hello,

I am trying to use the navigator to my chart and make use of its realtime zooming capabilities (intervals) Year/Month, Month/Week, Week/Day, etc.... It was working normally for a while, however after adding a certain number of data, it refuses to zoom in further than Month/Week interval. Week/Day and Day/Hour no longer appears. Intervals for Year/month, month/week are still working on the realtime zoom. (See attached image)

Not sure if this was an intended feature or if I messed something up. How can I get it to zoom further into Week/Day ?


Regards,
Attachments
HighChartGantt-issue.PNG
HighChartGantt-issue.PNG (20.97 KiB) Viewed 2636 times
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hello JayColon021,

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

To tell exactly why it behaves like that I need you to provide me with simplified working demo. You can start here:
https://jsfiddle.net/BlackLabel/8oj4zxf3/

Regards!
Mateusz Bernacik
Highcharts Developer
JayColon021
Posts: 5
Joined: Thu Dec 09, 2021 7:19 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hello Mateusz,

Thank you for the response. Try checking out this fiddle: https://jsfiddle.net/tpfqgdh2/

Apologies in advance if its quite long and a bit messy. Try squeezing the navigator, as you can see it does not go any deeper than Month/Week. If you expand the navigator out it show Year/Month.

Then try removing the last two entries in the series data right here:

Code: Select all

// Comment out these two last entries to get the zoom for Week/Day working again

        {
            name: 'Introduction of IT Teams',
            id: 'passed_inspection_1',
            parent: 'inspect_building',
            start: Datetime_UTC('2021-01-14'),
            end: Datetime_UTC('2021-01-21'),      
            completed: {
                amount: 1
            },
            owner: 'Matt'
        },
        {
            name: 'IT Governance / Security',
            id: 'passed_inspection_2',
            parent: 'inspect_building',
            start: Datetime_UTC('2021-01-21'),
            end: Datetime_UTC('2021-01-30'),      
            completed: {
                amount: 1
            },
            owner: 'Matt'
        }
        
     // End of data
If you try to run this again it should go deeper into Week/Day zoom.


Regards,
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hi JayColon021,

Thanks for the demo. Unfortunately it is a bug, we are aware of it but we don't have ETA for a fix at this moment. As a workaround I would suggest using afterSetExremes event to update X axis depending on current date range.
Demo: https://jsfiddle.net/BlackLabel/yq25g4mw/
API reference: https://api.highcharts.com/gantt/xAxis. ... etExtremes,
https://api.highcharts.com/class-refere ... xis#update

Let me know if you have any further questions!
Regards!
Mateusz Bernacik
Highcharts Developer
JayColon021
Posts: 5
Joined: Thu Dec 09, 2021 7:19 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hi mateusz,

Thanks.

This will do nicely for my issue. I did notice that once you get the update function from the afterSetExtremes to trigger, it effectively updates the tick interval for all date ranges. It will show as Week/days even when you're zoomed out for the range of the whole year. I figure I could just add an else statement to revert back to default tickinterval behavior when its not zoomed in to the weeks level

Code: Select all

else{
	this.update({
	tickInterval: null
	})
}
Many thanks for this.

Regards,
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hi JayColon021,

Exactly, it works like that. You can also add more conditional statements and adjust interval even further. Glad to hear you like the solution.

In case of any further questions feel free to contact us again.
Regards!
Mateusz Bernacik
Highcharts Developer
h_pai_
Posts: 1
Joined: Fri Dec 02, 2022 6:17 am

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hi,

Is the bug resolved?
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Zoom no longer automatically shows x-axis Weeks/Days

Hello,

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

You could send an online demo of what exactly you have a problem with, because it may be that it is not entirely related to this topic. Then I can say more.

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Gantt”