gmoubarakParticipantOctober 24, 2016 at 11:03 amPost count: 9
I’m displaying two gantts: one showing the activity sequence per object and another showing the activities per resrouces.
I need to keep the same zoom factor when switching between them.
before moving to the other gantt I read the visibleStartTime and visibleEndTime values and then I set those values on the next gantt by calling showRange().
The zoom is not adjusted according to the values read from the previous gantt.
Is there any better way to keep both gantt synchronised?
- This topic was modified 2 years, 7 months ago by Dirk Lemmermann.
Dirk LemmermannKeymasterOctober 24, 2016 at 11:03 amPost count: 71
If the two charts are showing at the same time then you need to add a bidirectional binding between the “millisPerPixel” and the “startTime”property of the two timeline models used by the two timelines of the two Gantt charts.
TimelineModel model1 = gantt1.getTimeline().getModel(); TimelineModel model2 = gantt2.getTimeline().getModel(); Bindings.bindBidirectional(model1.millisPerPixelProperty(), model2.millisPerPixelProperty()); Bindings.bindBidirectional(model1.startTimeProperty(), model2.startTimeProperty());
If the two charts are shown one after the other then you can do this:
TimelineModel model1 = gantt1.getTimeline().getModel(); TimelineModel model2 = gantt2.getTimeline().getModel(); model2.setMillisPerPixel(model1.getMillisPerPixel(); model2.setStartTime(model1.getStartTime());
- This reply was modified 2 years, 7 months ago by Dirk Lemmermann.
You must be logged in to reply to this topic.