Gantt > Gantt Chart Functionalities > Time Scales and IlvGanttChartForm
 
Time Scales and IlvGanttChartForm
The IlvGanttChartForm class can use external graphic objects as scales. The sample <ILVHOME>/samples/gantt/calendar shows how to use an IlvCalendarScale object as the scale of the IlvGanttChartForm. The external scale can be specified by calling the method IlvGanttChartForm::setCompositeScale().
Positioning the Time Scales
When you create an IlvCalendarScale, the horizontal position and size of the scale must correspond to the start and end parameters of the Gantt chart. The height of the scale must be the same scale height parameter you used for creating the Gantt chart. The Y position of the scale is supposed to be -100, so the bounding box of your scale is defined by the following IlvRect:
IlvRect(start, -100, end-start, scaleHeight)
In cases where your time scale is not created with the position and dimension mentioned above, the IlvGanttChartForm places the time scale at the correct position and dimension in the Gantt chart form when you call the method setCompositeScale().
Using Time Converters
The time scales, such as IlvCalendarScale, use IlvTimeConverter to convert the dates to coordinates used to draw the scales. The IlvGanttCalendarGrid, used in the sample <ILVHOME>/samples/gantt/calendar, also uses an IlvTimeConverter. To make the time scale and the calendar grid synchronous, we suggest that the time scale and the calendar grid use the same time converter.
If you use dates to define the start and end times of the activities, you need to convert them to grapher coordinates in order to add them to the Gantt chart. We suggest you use the same time converter as the time scale and the calendar grid to make the conversions.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.