2. Main bar parts
Discrete main bar with more milestones
-
There are five tutorials for Gantt task types and features:
- See documentation for Main bar
-
The discrete main bar is defined by
GanttParts
attribute, as one or more date ranges like "1/1/2010~1/3/2010;1/8/2010~1/12/2010".
It is also possible to define the attributes GanttStart, GanttEnd and GanttDuration, their values will be calculated from the GanttParts.
-
If set GanttLastUnit, the set end date is increased by this one unit (usually 'd' as day), the second date in every range in GanttParts and the GanttEnd means the last unit in this case.
-
The individual parts of the discrete main bar cannot be individually identified, after move or resize they are automatically joined and sorted.
To have individually identified parts use GanttRun instead, see 4. Main bar by Run.
When moving one main bar part on another, they are automatically joined
. To not join them set GanttJoin attribute to 0 or -1.
If you want to overlay the boxes with some text on them, you can set GanttTextOverlay='1' to show only one text at one place.
-
To support dependencies, resources, manual start, percentage completion and disabled / locked state there must be set
GanttTask
to the main bar plan like "Main", "Main1", "Main2", ... or for all plans as "All".
Default setting is GanttTask="Main" = only the first main bar plan supports the task features.
Dependencies are always attached to the whole task - only to start of the first part and / or to end of the last part. To attach dependencies or resources to individual boxes, use GanttRun instead.
-
Milestone
is created as a range with only start or end defined, like "1/10/2010~" as start milestone or "~1/1/2010" as end milestone.
Don't confuse with range defined only by one date like "1/10/2010" - it means one day bar.
There is difference between start milestone and end milestone. The end milestone is affected by GanttLastUnit
and also if the milestone is set within excluded range, the end milestone is shown before the range and start milestone after the range.
The milestone has only two states: complete (GanttComplete=100) and incomplete.
There can be more milestones or bars and milestones together in one main bar, but for the Gantt calculation it has no effect.
-
Main bar
content
is defined by GanttHtml
attribute. Main bar can show any text or html code. Milestone cannot show any content.
The content is for all the parts the same, but it can show the part specific index or start date, end date or duration.
The discrete main bar usually does not show user text defined by GanttText attribute, because it would be shown in every part.
The main bar content can be generated also dynamically for every part different by OnGetGanttHtml API event.
-
Main bar
side text
. Main bar can show two side texts or any HTML content. The side texts are defined by GanttHtmlLeft
and GanttHtmlRight
.
The texts horizontal position is controlled by GanttHtmlLeftEdge and GanttHtmlRightEdge, the available positions are before, inside left, centered, inside right and after.
Vertical position is set by GanttHtmlShift. It is also possible to generate the side texts by API event OnGetGanttSideHtml to achieve any count and positions of the main bar side content.
By the API event create especially different content for individual parts.
-
Main bar
tooltip
is defined by GanttTip
. Milestone tooltip is defined by GanttMilestoneTip. The tip can show any text or html code.
The tip is for all the parts the same, but it can show the part specific index or start date, end date or duration.
By default the main bar tooltip shows user text defined by GanttText
attribute.
The main bar and milestone tooltip can be generated also dynamically for every part different by OnGanttTip API event.
-
Task
percentage completion
is set by GanttComplete
attribute in range 0 - 100.
The task completion is set and calculated for the whole task, not for the individual parts.
The completion state is shown only if the main bar plan is included in GanttTask, see above.
If used calendar / excluded dates, the percentage completion can be shown preciselly for the excluded dates if set GanttExcludeComplete.
To round the percentage completion to some units (GanttUnits or GanttDataUnits) when is set by click to bar use GanttRoundComplete.
-
Task can be
disabled
or locked
. The state is set by GanttDisabled
attribute or column.
Only the whole task can be disabled or locked, not the individual parts.
The disabled / locked state is used only if the main bar plan is included in GanttTask, see above.
Disabled task cannot be changed and is also ignore in all calculations. Locked tasks cannot be changed.
It is possible to permit changing the disabled/locked tasks manually by a user by GanttEditDisabled='1'.
To have not editable task, remove the main bar plan from GanttEdit and also set CanEdit='0' to all the source cells.
-
Dependencies
are attached always for the whole main bar not to individual parts. Normally by GanttDescendants
or by GanttAncestors
.
To the first part are attached start dependencies, to the last part are attached finish dependencies.
If the GanttTask contains only one main bar plan and also no run/box, the main bar need not be identified for dependency and the row id is enough, e.g. GanttDescendants = "R1" or "R2#11;R3"
If the are more flags in GanttTask, the main bar is identified by its plan number, 0 for the first one, e.g. GanttDescendants="0@R1" or "1,1@R2#11;0,1@R3"
See documentation for Defining dependencies.
-
Manual start
for correcting dependencies is set by GanttManual
.
It is permitted / controlled by attributes GanttManualChange and GanttManualSide.
-
Resources
are attached by GanttResources.
See documentation for Resources assign.
-
Main bar
style
can be controlled by GanttClass
attribute. For side texts by GanttHtmlLeftClass and GanttHtmlRightClass.
For milestones can be set special class by GanttMilestoneClass. The milestone class specifies predefined or custom icon for milestone.
There are predefined 17 standards colored bars and 10 colored milestones.
-
The main bar can show
side icons
on one or both its sides just for visual effect, set by GanttIcons.
The icons can be default icons for summary tasks or any custom icons defined by GanttIconLeft and / or GanttIconRight.
There are also special interrupt icons that can be shown between the main bar parts.
-
Main bar
position and height
.
Main bar can be shifted vertically by GanttTop attribute.
The height of the main bar can be set by GanttHeight attribute.
All parts in one main bar have the same height and vertical position. Except the part height is updated according to the part content.
-
When
moving
the first part of the discrente main bar by dragging, all parts are moved. When dragging other parts, only the one part is moved. This behavior can be changed by assigning different actions to the drag events.
When moving discrete main bar for correcting dependencies, always the whole bar moved, all the spaces between parts are preserved.
-
Main bar can be controlled also from JavaScript by
API
, especially by methods GetGanttMain and SetGanttMain and events OnGanttMainChange and OnGanttMainChanged.