7.2.11 GanttChart

Beside all attributes of TimeWidgetChart (see 7.2.3) and TimeAxisChart (see 7.2.8). this class specifies the following additional attributes:

data
A task or any sequence of tasks that should be displayed in the chart.

show_connectors
A boolean value that specifies wether to display connectors between tasks.

show_complete
A boolean value that specifies wether to display a completion bar inside the gantt bars.

row_attrib
A string value specifying the name of the row attribute inside the project definitions. With this attribute you can control in which row a task will be displayed.

accumulate_attrib
A string value specifying the name of the accumulate attribute inside the project definitions. If a parent task defines the accumulate attribute as True it will be displayed as leaf, and all child tasks will not be displayed.

shape_attrib
A string value specifying the name of the shape attribute inside the project definitions. The shape attribute controls the displayed shape of the gantt object.

shape_properties_attrib
A string value specifying the name of the shape properties attribute inside the project definitions. The shape properties attribute controls the style properties of the gantt object.

parent_shape
A string value specifying the name of the general shape for parent tasks.

leaf_shape
A string value specifying the name of the general shape for leaf tasks.

milestone_shape
A string value specifying the name of the general shape for milestone tasks.

title_attrib
A string value specifying the name of the task attribute that should be displayed at the gantt object, to identify the task.

show_resource
A boolean value that specifies wether to display the allocated resources after the title.

properties
Specifies a dictionary of display properties. Every shape has its own style group. Several shapes have also an additional style attrib like up. A special style group complete specifies the styles for the completion bar inside a gantt bar. The special style attribute height specifies the height of a bar in multiples of VSEP.

create_objects( data)
Overwrite this method, if you want to change, which tasks will be displayed. The method has to yield every task, that should be displayed. The default implementation of create_gantt_objects is:
for t in data:
    if getattr(t, self.accumulate_attrib, False) \
       and t.is_inherited(self.accumulate_attrib):
       continue

    yield t

modify_widget( widget, task)
Overwrite this method to decorate a widget.

modify_connector( src, dest, connector)
Overwrite this method to change a connector. src, dest are the start and end widgets of the connector. To get the tasks of the widgets use their fobj attribute. connector is the ConnectorWidget. If the connector should be displayed the method has to return True and False otherwise.