Timeline Object Renderer


FlexGantt uses so-called timeline object renderers in order to visualize timeline objects retrieved from the Gantt chart model. Applications built on top of FlexGantt have to implement their own timeline object renderers when they want to customize the appearance of the timeline objects on the right-hand side of the Gantt chart (the layer container). FlexGantt itself provides only two of these renderers. One for default timeline objects and one for activity timeline objects (DefaultTimelineObjectRenderer, DefaultActivityObjectRenderer).

Timeline object renderers need to implement the ITimelineObjectRenderer interface, which consists of two methods. The first method returns the component that will perform the actual rendering. The second one returns insets, which are used to position the rendering component inside the row where it will be used. An inset of (0, 0, 0, 0) will cause the component to use the entire height of the row and the entire width based on the start and end time of the timeline object. Positive insets will cause the component to use less of its bounds, negative insets will have the reverse effect allowing the component to use more screen real estate than standard.

The following two illustrations show how insets can be used to trim a timeline object. Insets are especially important when a timeline object is not an activity but an event, meaning that it has no duration but only a time point. In this case the renderer would usually only be given a width of one pixel but in most cases events are drawn as diamonds or with an icon and require more space.


capturedata5327672

capturedata4586501

Relevant API


public void TimelineObjectLayer.setTimelineObjectRenderer(Class, ITimelineObjectRenderer);