Zoom to Fit by Default


#1

Hello,

I am having trouble in zooming the chart ‘to fit’ by default. I want my user to see the whole thing then zoom in or out.

I got so fed up that I copied the sample ‘Zoom to Fit’ sample, and use it as a first point, but actually I can’t even replicate that on my server.

I think the problem has to do with ordering the JS in footer or something.
The data script is:

The only difference I notice between the ‘Zoom to Fit’ sample, and my chart is, ‘demo_tasks’ uses ‘start_date’ and duration in sample. But ‘start_date’ and ‘end_date’ in my chart.


#2

Hello Ali,
It may or may not be related to Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.

Please, add your configuration in the following snippet and make sure that the issue is reproduced there:
https://snippet.dhtmlx.com/38ee1b370
Then, click on the Share button and send me the link.
Or send me a ready demo with all the necessary Javascript and CSS files so that I can reproduce the issue locally.