a.goutam
Posts: 4
Joined: Wed Feb 24, 2021 7:41 am

Programmatically move navigation

Hi,

I would like to move the navigation time range for gantt chart programmatically. Any idea of how can I achieve this?
Attachments
Screenshot 2021-02-24 at 1.17.27 PM.png
Screenshot 2021-02-24 at 1.17.27 PM.png (87.55 KiB) Viewed 1100 times
Screenshot 2021-02-24 at 1.17.27 PM.png
Screenshot 2021-02-24 at 1.17.27 PM.png (87.55 KiB) Viewed 1100 times
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Programmatically move navigation

Hello a.goutam!

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

There are a lot of ways of how we can move the navigator from API. Maybe any of them will meet your expectations? For example, we can use top/bottom property to move it to the top/bottom of the chart, we've also got margin property to move it a little from a position set by the top and bottom properties

API references:
https://api.highcharts.com/gantt/navigator.margin

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

If you want to do it programmatically please describe your requirements precisely. :-)

Best regards!
Dominik Chudy
Highcharts Developer
a.goutam
Posts: 4
Joined: Wed Feb 24, 2021 7:41 am

Re: Programmatically move navigation

dominik.c wrote: Wed Feb 24, 2021 11:24 am Hello a.goutam!

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

There are a lot of ways of how we can move the navigator from API. Maybe any of them will meet your expectations? For example, we can use top/bottom property to move it to the top/bottom of the chart, we've also got margin property to move it a little from a position set by the top and bottom properties

API references:
https://api.highcharts.com/gantt/navigator.margin

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

If you want to do it programmatically please describe your requirements precisely. :-)

Best regards!

I do not want to move the position of navigation but the navigation sliders through API. As we can easily move it by dragging the sliders but as per our requirement, I have to sync this timeline with another timeline. So if a user moves that another timeline, this highchart timeline should also move.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Programmatically move navigation

Hi again!

Oh all right, I didn't understand you correctly.

Moving sliders on the navigator mean changing the xAxis range and we can do it using setExtremes method on the axis. It's the simplest way of doing it with Highcharts. :)

API references:
https://api.highcharts.com/class-refere ... etExtremes

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

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Gantt”