There's a slight bug in Gantt's startup which places what should be the center date at the right edge. I can fix that.
But the issue is that you have copy/pasted the "Advanced" example which was not designed to use infinite scroll, and seems to have a bug:
onProjectStartDateChange(obj:any){
this.gantt = this.ganttComponent.instance;
if (!obj.oldValue) { // ignore initial set
return;
}
this.gantt.startDate = DateHelper.add(obj.value, -1, 'week');
(this.gantt.project as any).setStartDate(obj.value);
}
this.gantt.startDate =
sets the start point of the horizontal time axis.
Infinite scroll expands the scrollable range of the gantt so that it scrolls a lot before it needs to shift its viewport.
So on startup it looks like this:
See how narrow the thumb is? The visible task bars are in the center, but there's a lot of space either side.
The gantt.startDate
is Sun Jul 22 2018, way off to the left:
(I meant 2019, not 2919, but the image is fixed now)
So when this is set, the range of the horizontal time axis stays the same. The same size time range is covered, but it starts at the project start. So it's way off left.
Do not set gantt.startDate
.