Gantt compute
TreeGrid documentation
TreeGrid Gantt chart support various features for project management computations.
Dependencies between tasks. These dependencies can be automatically checked and corrected after any change in the Gantt.
It is possible to set dependency
type (ss,sf,fs,ff), dependency
lag (reserved time between dependency start and its end), and dependency
float (maximal permitted time between dependency start+lag and its end)
Start date - base start date of the whole project, no task should start before this date, all first tasks should start on this date.
Finish date - finish date of the whole project, no task should end after this date, used to calculate critical path.
Date constraints - early start, late start, mandatory start, early end, late end, mandatory end - maximal and minimal end and start date of the task.
Critical path - marks the tasks, that cannot move to future (be delayed) to not affect project finish date.
Summary tasks - group of tasks and their start, end and duration is summary of its children, their changes affect also their children.
Calendars (holidays) - excluding any dates or date ranges from the Gantt chart. These dates are ignored in calculations and can be highlighted or even hidden from display.
Described in separate document
GanttCalendars.
Data units
Base units for calculations and duration
chg 6.3 chg 14.0 <C> string
GanttDataUnits
['d']
Base unit time for Gantt data lengths, namely for attributes
GanttDuration,
GanttRun (
Duration) and
GanttDescendants and
GanttAncestors (lag, float).
Also
material resources are consumed per one GanttDataUnits.
If not set, the values are in milliseconds.
If used Gantt calendar (
GanttExclude or
GanttCalendar), these units are in workdays, it means
without the excluded dates.
To these units are usually the values rounded for calculations (but not for display, here are used
GanttUnits).
Since 6.4 it can be also any number for
number units, "1"as base number units, but it can be for example "0.5", "2", "10", "0.2", ...
Since 6.6 it is also possible to replace the unit character by its value in milliseconds, for example 'd' is 24*60*60*1000='86400000'. And use such way for some custom units, for example "8 hours" units can be set as "28800000".
The supported units are:
'
ms' - milliseconds, "
ms10" - 10 milliseconds, "
ms100" - 100 milliseconds,
'
s' - seconds, '
s2' - 2 seconds, '
s5' - 5 seconds, '
s10' - 10 seconds, '
s15' - 15 seconds, '
s30' - 30 seconds,
'
m' - minutes, '
m2' - 2 minutes, '
m5' - 5 minutes, '
m10' - 10 minutes, '
m15' - quarters of hour, '
m30' - halves of hour,
'
h' - hours, '
h2' - 2 hours, '
h3' - 3 hours, '
h6' - quarters of day, '
h8' - thirds of day, '
h12' - halves of day,
'
d' - days, '
w' - weeks (starting by
FirstWeekDay), '
w0' - weeks (starting by Sunday), '
w1' - weeks (starting by Monday), '
w6' - weeks (starting by Saturday),
'
M' - months, '
M2' -
(new 10.0) two months, '
M3' - quarters of year, '
M4' -
(new 10.0) four months, '
M6' - halves of year,
'
y' - years, '
y2' - 2 years, '
y3' - 3 years, '
y4' - 4 years, '
y5' - 5 years, '
y10' - 10 years, '
y20' - 20 years, '
y50' - 50 years
(2-50 year is new 10.0)
The "
ms" units can be used for any integer values, not only dates.
Prior to 14.0.10 the "w" was starting on Sunday, "w1" in Hijri started on Saturday and "w0" and "w6" did not exist.
new 6.3 <C> string
GanttDataModifiers
['']
Comma separated list of possible modifiers of
GanttDataUnits in format name1:value1,name2:value2,....
These modifiers can be used to multiply or divide the duration value.
For example
GanttDataUnits='h' GanttDataModifiers="dd:24,d:8,h:1,m:1/60" GanttDuration="7d". It means the 7d value is 56 hours (7x8).
Remember the difference between these custom modifiers and TreeGrid Gantt units. The custom modifiers can be used only for duration set in data units and multiply the value. The Gantt units are used in other settings and represent fixed size. The Gantt units cannot be renamed.
new 9.1 <C> string
GanttLastUnit
['']
If set to some
GanttDataUnits unit, adds this unit to every ending date that is rounded to this unit.
If affects ending date of main bar
GanttEnd, second date in
Parts or
Run, project finish
GanttFinish, ending constraints
GanttMaxEnd and
GanttMinEnd and also
GanttManual,
GanttRunManual and Run box
Manual on right side.
It affects only dates that are rounded to the GanttLastUnit unit, other dates are unchanged.
The most common value is '
d' for adding one day to all ending dates that are in the whole days. It means the date represents the last day.
For example if
GanttLastUnit='d', the value
GanttEnd='1/1/2000' will be displayed in chart as '1/2/2000', but
GanttEnd='1/1/2000 10:00' will be displayed the same as '1/1/2000 10:00'
It replaces GanttEndLast, value 2. Since 9.1. the default behavior changed, because prior to this version the GanttLastUnit as GanttEndLast was set to value of GanttDataUnits!
new 6.3 deleted 9.1 <C> int
GanttEndLast
[1]
Since 9.1 it was replaced by GanttLastUnit and default value and behavior changed!
If set to
1, ending date (
GanttEnd, second date in Parts or
Run) means the last included date.
(Since 8.1) If set to
2, it is used also for
GanttFinish,
GanttMaxEnd and
GanttMinEnd.
It means the ending date is always increased for one
GanttDataUnits unit for display and compute Gantt chart.
For example range "1/1/2000~1/3/2000" with units 'd' (days) will be
3 days for
GanttEndLast='1' and
2 days for
GanttEndLast='0'.
Defining dependencies
Dependencies between tasks - lines and arrows between main bars or run bars
The dependencies are defined in
GanttDescendants as next dependencies or in
GanttAncestors as previous dependencies or in both (they are mirrored).
The dependencies can be assigned to Gantt tasks, the Gantt bars used as Gantt tasks are listed in
GanttTask. By default the Gantt task is only the first main bar plan.
There are supported four
dependency types (
fs finish-start,
ss start-start,
sf start-finish,
ff finish-finish).
If the dependency start is different from the dependency end (in time), the dependency can be marked as incorrect and shown in different color (usually in red), according to the
GanttIncorrectDependencies setting.
The incorrect dependencies can be automatically corrected by moving the task to future. There is also available method to correct all incorrect dependencies in grid or for the specified task.
You can correct all incorrect dependencies automatically by setting
GanttCorrectDependencies.
Every dependency can have specified a
lag - reserved time between dependency start and its end, the lag is used to check if the dependency is correct or not and when correcting dependencies.
Every dependency can have specified a
float - maximal permitted time between dependency start+lag and its end , the float is used to check if the dependency is correct or not and when correcting dependencies.
To
copy & paste the Gantt dependencies it must be set
CopyPasteInternal
or
since 13.3 there must be defined and copied column named "
id" that contains the row ids
or
since 13.3 there must be copied column
IdNames and
IdNames must contain only one column and
FullId must be
0.
new 6.3 upd 10.0 <C> <cell> string
GanttDescendants
Gantt source - column name or exact value
A list of row ids of (next) dependent tasks, separated by semicolon. The dependencies are shown as arrows.
It can contain also information about dependency
type,
lag,
float and
color.
The complete format is
from,to@idtype+/-lag!float#color
The
from,
to and
id strings must
not contain the characters
, @ + - ! #
Only Gantt bars listed in GanttTask can have dependencies!
from | (since 10.0) is main bar plan (0,1,2...,X) or run box id or '-' for run bar, in the source row from that dependency starts. It must end with , It can be omitted for the first GanttTask, if it is not Box. |
to | (since 10.0) is main bar plan (0,1,2...,X) or run box id or '-' for run bar, in the destination row to that dependency ends. It must end with @ It can be omitted for the first GanttTask, if it is not Box. |
id | is a row id the line is connected to. In GanttAncestors it is a row id the line is connected from. It is the only required part of the definition. |
type |
sets edges of task connected. If missing, FS is used. Possible dependency types:
SS (start->start), descendant can start after ancestor starts
SF (start->end), descendant can finish after ancestor starts
FS (end->start, default), descendant can start after ancestor finishes
FF (end -> end), descendant can finish after ancestor finishes
|
lag | is reserved time between ancestor/predecessor task edge (start or end) and dependency start, in GanttDataUnits or with time unit character like +3d is three days. It must start with + or -.
The default value of lag is 0.
Since 9.3 it can be also in percentage of task duration.
Since 12.0 the percentage can be rounded by GanttLagRound. |
float | is maximal permitted time between dependency start and dependency end, in GanttDataUnits. It must start with !
The dependencies that have the time between start and end larger than their float are marked as incorrect and the tasks should be corrected.
If the value is missing (empty space after !), the float is unlimited. The default value of float is empty (unlimited) or 0 (strict), according to GanttIncorrectDependencies and GanttStrict setting.
Since 9.3 it can be also in percentage of task duration.
Since 12.0 the percentage can be rounded by GanttLagRound.
|
color | (since 10.0) is a number of color and shape for the dependency line. It must start with #.
There are ten colors: 0 - blue, 1 - green, 2 - orange, 3 - black, 4 - fuchsia, 5 - aqua, 6 - lime, 7 - yellow, 8 - silver, 9 - red, that are related to the some of the GanttClass and run Class colors.
There are four tens of different shapes with above colors: 0 - 9 (thin outset line), 10 - 19 (thin inset line), 20 - 29 (thick outset line), 30 - 39 (thick inset line).
The colors and other attributes can be redefined in Gantt.css for used style, by the five CSS classes GxGanttDepX, GxGanttDepXLag, GxGanttDepXIE, GxGanttDepArrowXLeft, GxGanttDepArrowXRight.
If not set, GanttDependencyColor is used.
The dependency color and shape can be changed due dependency state (e.g. incorrect, disabled, critical, etc.), see dependency colors.
Example: 10; 11ss; 12+3; 13ff-1d; 14+22h!; 15sf-4!2#7 means in full notation: 10fs+0!0; 11ss+0!0; 12fs+3!0; 13ff-1d!0; 14fs+22h!; 15sf-4!2#7
Since v6.3 replaces Dependencies, DependencyTypes and DependencyLags. |
new 6.3 upd 10.0 <C> <cell> string
GanttAncestors
Gantt source - column name or exact value
A list of row ids of previous tasks that this task depends on. The format is the same as
GanttDescendants.
One dependency between two tasks can be set in
GanttDescendants of the first tasks or in
GanttAncestors of the second tasks.
If in the grid there are both columns, they are mirrored, but it slows down the grid.
The ancestors settings have only changed the task id, all other settings (type,lag,float) are the same as if the dependency is defined in descendants.
deleted 6.3 <C> <cell> string
GanttDependencies
Gantt source - column name or exact value
Replaced by GanttDescendants.
A list of row ids of (next) dependent tasks, separated by semicolon. The dependencies are shown as arrows.
By default (depending on css style) are correct arrows in blue and incorrect arrows (start+lag > end) are in red.
Any task can be dependent on more others.
The arrows start from this task and points to the tasks specified by dependencies ids. See also
GanttDependencyTypes.
deleted 6.3 <C> <cell> string
GanttDependencyTypes
["fs"] Gantt source - column name or exact value
Replaced by GanttDescendants.
A list of dependency types for individual
GanttDependencies, separated by semicolon, case insensitive
Possible dependency types: SF (start->start),
SF (start->end)
FS (end->start, default),
FF (end -> end)
deleted 6.3 <C> <cell> string
GanttDependencyLags
[0] Gantt source - column name or exact value
Replaced by GanttDescendants.
A list of dependency lags for individual
GanttDependencies, separated by semicolon
The lag is reserved time between
GanttEnd and dependency start, in
GanttDataUnits. Can be column name or array of integers.
<C> int
GanttMaxDependencies
[100]
Maximum of rendered crossing dependencies. When the maximum is reached, some crossing dependencies will be rendered partially.
For large tables and specific sorting or grouping there can be thousands of crossing dependencies and it can lock the grid because it will be too slow to render.
new 9.1 <C> bool
GanttShowDependencies
[1]
For
1 all dependency lines are shown, for 0 no dependency line is shown.
Affects only display, not calculations and correcting.
For
0 users are also able to delete the dependencies from menu, but not by clicking to the dependency line.
new 9.3 API method void
SetGanttShowDependencies
(bool value, bool show = 1, string col)
Changes value of GanttShowDependencies dynamically.
value is the new value to set.
new 10.0 <C> <cell> string
GanttDependencyTip
["*From* (*Start*) -> *To* (*End*) *Type* *Float*"]
Tip string shown for dependency on mouse hover.
It can also show values from other cells in row, set by
*col* where col is the column name.
It can show also the specials:
*Start* - start date of the dependency,
*End* - end date of the dependency.
*From* - row name the dependency comes from,
*FromBox* - main bar plan number or run box id the dependency comes from
*To* - row name the dependency goes to,
*ToBox* - main bar plan number or run box id the dependency goes to
*Type* - dependency type, fs, ff, sf, fs,
*Lag* - dependency lag in GanttDataUnits,
*Float* - End - Start + Lag in GanttDataUnits
To dynamically generate the tip text use
OnGanttTip API event.
new 10.0 <C> <cell> string
GanttDependencyTipDateFormat
Date format for
GanttDependencyTip values *Start*, *End*
new 6.6 chg 8.0 upd 9.1 <C> int
GanttAllDependencies
[2]
0 | Shows dependencies between visible tasks. It was default and only setting in TreeGrid prior 6.6!
Correcting dependencies affects also only visible tasks and ignores all hidden dependencies, so it will give different results for different filters. |
1 | Shows all dependencies. The dependency between visible and hidden task will be unconnected and also other visual distortions can be displayed.
Correcting dependencies affects always all tasks, so it does not depend on filter settings. |
2 | Shows dependencies between visible tasks, but calculates and corrects always all dependencies and tasks. Added and default value since 8.0 |
3 | (new 9.0) Like 2, but shows (unconnected) dependencies if at least one dependent task is visible. |
4 | (new 9.0) Like 2, but hides dependencies between collapsed children. Can remarkably slow down expanding / collapsing rows for larger grids. |
5 | (new 9.0) Like 4, but shows (unconnected) dependencies if at least one dependent task is visible (its parent is expanded). Can remarkably slow down expanding / collapsing rows for larger grids. |
new 10.0 <C> int
GanttAdjacentDependencies
[1]
How will be shown dependencies between adjacent boxes on the same level (the straight dependency line). Affects only dependencies without lag.
If there is no room for the straight dependency, the dependency line is shown around as rectangle.
0 | Reserves room for dependency stub and arrow |
1 | Ignores width of the stub, reserves room only for dependency arrow |
2 | Ignores width of the stub and arrow, shows the dependency always as straight |
new 11.0 <C> int
GanttBypassDependencies
[0]
How the dependencies will bypass bars when going through. Bit array. If set to
0, it crosses the bars.
1. bit (&1) | If set, the dependency between rows goes horizontally always bottom the row (below the first box). |
2. bit (&2) | If set, the dependency inside one row goes horizontally always bottom the row (below the first box). |
new 12.0 <C> int
GanttLagRound
[0]
If and how the dependency lag and span/float will be rounded to
GanttDataUnits, if set in percent.
0 - no,
1 - rounded,
2 - rounded up (ceil),
3 - rounded down (floor).
new 13.2 <C> bool
GanttLagDescendants
[0]
If set to 1, it calculates lag as negative delay of the descendant task. For 0 the lag is delay of ancestor task.
Useful especially if tasks have different calendars.
new 9.3 chg10.0 API event void
OnGetDependency
(TGrid grid, TRow row, string col, type[] dep, int start, int end, int dur)
Called to modify lag, span or color of parsed descendant dependency in array
dep.
dep = [0: id, 1: type, 2: lag, 3: span, 4: lagpercent, 5: spanpercent, 6: color, 7: boxfrom, 8: boxto],
id (read only) is the id of the next task,
type (read only) is ss,sf,fs,ss,
lag is lag value (in GanttDataUnits without excluded units or if percentage in range 0-1 (or more than 1 too)),
span is span value (units like lag),
lagpercent /
spanpercent is 1 if lag / span was set with %
color (since 10.0) is number of color of the dependency
boxfrom (read only) (since 10.0) is a main bar plan or run box id the dependency comes from
boxto (read only) (since 10.0) is a main bar plan or run box id the dependency goes to
the
boxfrom and
boxto are always set, even if the dependency string does not contain them - in this case they are set to the first
GanttTask like: run = '-', main = 0, main1 = 1, main2 = 2, ...
start is start date of the dependency,
end is end date of the dependency,
dur is
end -
start in milliseconds, but without excluded units.
Dependency colors and shapes
Base dependency color and shape is defined by #color suffix in
GanttDescendants /
GanttAncestors.
new 10.0 <C> int
GanttDependencyColor
[0]
The first (default) color assigned to dependencies for
GanttAssignDependencies.
Can contain any color and shape, value in range 0 - 39.
new 10.0 <C> int
GanttAssignDependencies
[0]
How will be color assigned to dependencies when the dependency has no color set or there are more same (colliding) colors assigned to dependencies to or from same box edge.
0 - all dependencies without color get the
GanttDependencyColor.
1 - all dependencies without color get the
GanttDependencyColor or if colliding, colors within the same shape (0-9).
For example if set
GanttDependencyColor=15, incorrect color is 9 and disabled color is 8, the assigned colors will be 15,10,11,12,13,14,16,17,15,15,15,...
2 - all dependencies without color get the
GanttDependencyColor or if colliding, colors within the same shape (0-9) and next shapes (but not previous).
For example if set
GanttDependencyColor=15, incorrect color is 9 and disabled color is 8, the assigned colors will be 15,10,11,12,13,14,16,17,20,21,22,23,24,25,26,27,30,...,37,15,15,15.
3 - all dependencies without color and dependencies with colliding color get the
GanttDependencyColor or if colliding, colors within the same shape (0-9).
4 - all dependencies without color and dependencies with colliding color get the
GanttDependencyColor or if colliding, colors within the same shape (0-9) and next shapes (but not previous).
The error color defined by
GanttColorIncorrectDependencies and disabled color defined by
GanttColorDisabledDependencies are never assigned.
If no color is available to set, the dependency gets the same color as it has already or the
GanttDependencyColor.
new 10.0 <C> int
GanttDependencyIcons
[3]
Which dependency icons will be shown:
0 none,
1 - arrow,
2 - start,
3 both arrow and start.
new 10.0 <C> int
GanttMarkIncorrectDependencies
[2]
If and how the incorrect dependencies will be marked by different color than normal dependencies.
0 - never, (but the dependencies will be still used as incorrect)
1 - only if no color is specified for the dependency. Mark is done by color 9, 19, 29, 39 (red by default).
2 - regardless on the color specified for the dependency, the mark is done by color 9,19,29,39 (red by default).
3 - by associated color, for error used sets 5-9, 15-19, 25-29, 35-39 (0 -> 5, 1->6, 2->7, 3->8, 4->9, ..., 10->15, ...). For this case only 0 - 4, 10 - 14, 20 - 24, 30 - 34 colors should be used for normal dependencies.
new 10.0 <C> int
GanttColorIncorrectDependencies
[9]
Color or shape for incorrect dependencies, options 2 and 3 in
GanttMarkIncorrectDependencies
0 -
9 specifies color value (added is shape as 00, 10, 20, 30). For example if the color is set to 9 and dependency has color 23, the incorrect dependency color will be 20+9 = 29.
10 -
13 specifies shape (10 => 00, 11 => 10, 12 => 20, 13 => 30, added is color as 0 - 9). For example if the color is set to 13 and dependency has color 23, the incorrect dependency color will be 30+3 = 33.
new 10.0 <C> int
GanttMarkDisabledDependencies
[2]
If and how the dependencies between disabled tasks will be shown and marked by different color than normal dependencies.
The dependency is disabled if at least one of the linked tasks has set
GanttDisabled or its row is
Deleted.
0 - hide disabled dependencies
1 - only if no color is specified for the dependency. Mark is done by color 8, 18, 28, 38 (red by default).
2 - regardless on the color specified for the dependency, the mark is done by color 8, 18, 28, 38 (red by default).
3 - by associated color, for disabled used sets 5-9, 15-19, 25-29, 35-39 (0 -> 5, 1->6, 2->7, 3->8, 4->9, ..., 10->15, ...). For this case only 0 - 4, 10 - 14, 20 - 24, 30 - 34 colors should be used for normal dependencies.
new 10.0 <C> int
GanttColorDisabledDependencies
[8]
Color or shape for disabled dependencies, options 2 and 3 in
GanttMarkDisabledDependencies
0 -
9 specifies color value (added is shape as 00, 10, 20, 30). For example if the color is set to 8 and dependency has color 23, the incorrect dependency color will be 20+8 = 28.
10 -
13 specifies shape (10 => 00, 11 => 10, 12 => 20, 13 => 30, added is color as 0 - 9). For example if the color is set to 13 and dependency has color 23, the incorrect dependency color will be 30+3 = 33.
Changing dependencies
Adding, deleting and modifying dependencies
new 6.7 <C> bool
GanttDeleteDependencies
[0]
If set to
1 and a user deletes row, all dependencies to and from the row task(s) will be deleted too.
new 7.0 <C> bool
GanttDragDependenciesAlways
[0]
For
1 when creating dependency by mouse dragging, it is possible to connect the dependency outside the bar(s), the dependency will be assigned to the nearest edge of the bar.
new 10.0 <C> int
GanttDragDependenciesMove
[1]
If the dependency can be created during dragging bar inside row.
0 - never, dependency can be created only by DragGanttDependency.
1 - after mouse cursor leaves the row with the dragged bar. But only if the bar is already moved less than 50 pixels.
2 - after mouse cursor leaves the row with the dragged bar.
new 10.0 <C> int
GanttDragDependenciesMore
[1]
Which dependencies will be permitted between two bars.
0 - only one dependency between two bars. Next dragged dependency replaces the old one.
1 - only one dependency between two bars, or there can be two dependencies, one ss and one ff. Next dragged dependency replaces the old one or the old two.
2 - more dependencies with different type between two bars. Next dragged dependency with the same type is refused.
3 - more dependencies even with the same type between two bars. Next dragged dependency is always permitted and gets type with index, e.g. fs, fs1, fs2, ...
More options can be achieved by
OnDragGanttDependency API event.
new 10.0 <C> int
GanttDragDependenciesBetween
[0]
Which dependencies are permitted between different bars.
0 - Only dependencies between main bars in the same plan are permitted.
1 - Dependencies between main bars in different plans are permitted.
2 - Dependencies between main bars in different plans are permitted. Also dependencies between main bar and run bar or box are permitted.
More options can be achieved by
OnDragGanttDependency API event.
new 6.3 upd 6.7 <C> int
GanttCheckDependencies
[2] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If and how will be checked circular dependencies between tasks.
If there is already some circular dependency among dependent tasks, the next one is always permitted.
0 - don't check,
1 - restrict circular dependencies,
2 - ask user,
3 - (new 6.7) shows alert about the circular dependency
new 6.3 chg 10.0 API event bool
OnCheckDependencies
(TGrid grid, object[] Dependencies)
Parameters changed in 10.0!
Called to check newly created dependency by dragging.
Return false to not create the dependency.
Dependency is array of new dependencies like returned by
GetDependencies, it usually contains only one dependency.
<Actions>
DragGanttDependency
Attached to OnDragGantt, cannot be attached anywhere else
Connects Gantt chart bar with another bar by dependency line, by mouse dragging.
Connects always from the first bar to the second bar.
When dependency types (ss,sf,fs,ff) are permitted by
GanttEdit, the left half of bar and the left side specifies 's', the right half of bar and right side specifies 'f'.
<Actions>
DeleteGanttDependency
Attached to OnCtrlClickGantt event
Deletes dependency line under mouse cursor.
<Actions>
DeleteGanttDependencies ...FA
Not attached to any event
Deletes all incoming and outgoing dependencies from actual or focused Gantt cell.
It fails if there is no dependency from and to the Gantt cell.
new 6.0 <Actions>
EditGanttDependencyLag
Attached to OnDblClickGantt event new 6.0.
It lets a user to edit lag value of dependency line under mouse cursor.
new 10.0 API method object[ ]
GetDependencies
(TRow row, string col, boot ancestors = null, TRow row2 = null, string type = null, string box = null, string box2 = null)
Returns all or selected dependencies for given Gantt cell [
row,
col]. The
row can be also string as row id.
If set
ancestors =
0 returns only outgoing dependencies (descendants), for
ancestors =
1 returns only incoming dependencies (ancestors). For
ancestors =
null returns both ancestors and descendants.
If set
row2, returns only dependencies between
row and
row2. The
row2 can be also string as row id.
If set
type, returns only dependencies with given type. Can be
ss,
sf,
fs or
ff. Can contain also any suffix to identify particular dependency if permitted more same dependencies.
If set
box, returns only dependencies of given box (main bar plan or run box id). The
box is in the [
row,
col] cell.
If set
box2, returns only dependencies of given box (main bar plan or run box id). The
box2 is in the [
row2,
col] cell.
Returns two dimensional array of values as:
[ [0: idfrom, 1: idto, 2: type, 3: lag, 4: span, 5: color, 6: boxfrom, 7: boxto, 8: start, 9: end, 10: lagms, 11: spanms, 12: col], [idfrom2, idto2, ...], ... ]
where: | idfrom is the row id the dependency comes from, idto is the row id the dependency goes to, type is ss, sf, fs or ff, |
| lag is dependency lag in data units or in percentage ending by %, span is permitted dependency span in data units or in percentage ending by %, color is a number of line color and shape. |
| boxfrom is a main bar plan or run box id the dependency comes from, boxto is a main bar plan or run box id the dependency goes to
- the boxfrom and boxto are always set, even if the dependency string does not contain them - in this case they are set to the first GanttTask like: run = '-', main = 0, main1 = 1, main2 = 2, ...
|
| start is dependency start date in milliseconds since 1/1/1970, end is dependency end date, lagms is dependency lag in milliseconds, spanms is permitted dependency span in milliseconds, col is Gantt column
- the start, end, lagms and spanms are calculated values and are not part of dependency definition.
|
new 10.0 API method void
DeleteDependencies
(object[ ] Dependencies)
Deletes given dependencies from Gantt chart.
The
Dependencies is two dimensional array as returned by
GetDependencies.
If created the Dependencies array manually, the individual dependencies must have set array items:
idfrom,
idto, optionally also:
type,
boxfrom,
boxto, other items are ignored.
new 10.0 API method void
AddDependencies
(object[ ] Dependencies)
Add given dependencies to the Gantt chart.
The
Dependencies is two dimensional array as returned by
GetDependencies.
If created the Dependencies array manually, the individual dependencies must have set array items:
idfrom,
idto, optionally also:
type,
lag,
span,
color,
boxfrom,
boxto, other items are ignored.
new 10.0 API method bool
TestDependencies
(object[ ] Dependencies, bool noalert = 0)
Tests circular dependencies when adding given dependencies to the Gantt chart.
The
Dependencies is two dimensional array as returned by
GetDependencies.
The Dependencies must be ancestors or descendants of one box only to work the function correctly!
If not set
noalert, it alerts messages according to the
GanttCheckDependencies value.
If set
GanttCheckDependencies = 0, it returns always true.
new 13.3 API method void
RemoveDeletedDependencies
( )
Removes dependencies from all deleted tasks.
Has sense only if not set
GanttDeleteDependencies and also not set AutoUpdate.
new9.2 deleted 10.0 API method object[ ]
GetDependency
(TRow row, string col, bool ancestors = 0)
Returns all dependencies for given task (Gantt cell).
For
ancestors = 0 returns all outgoing dependencies (descendants), for
ancestors = 1 returns all incoming dependencies (ancestors).
Returns two dimensional array of values as:
[ [id1,type1,lag1,span1],[id2,type2,lag2,span2],[id3....], ... ]
where
id is the row id in the other dependency end,
type is ss, sf, fs or ff,
lag is dependency lag in milliseconds,
span is permitted dependency span in milliseconds.
new9.2 deleted 10.0 API method bool
SetDependency
(TRow row, string col, type dependency, bool ancestors = 0, int check = 0, bool refresh = 1)
Sets all incoming (
ancestors=1) or outgoing (
ancestors=0) dependencies of given cell. All the previous (incoming or outgoing) dependencies will be cleared.
Updates all other dependency cells. For
refresh = 1 repaints the dependencies in chart. For
refresh = 0 it will be required to call
RefreshGantt(25) to repaint dependencies.
dependency can be two dimensional array as returned from
GetDependency method or string as standard dependency format used in
GanttDescendants or GanttAncestors.
For
check = 1 checks circular dependencies, for
check = 2 shows confirm dialog for circular dependency to a user.
Returns true for success or false for error.
Correcting dependencies
new 6.3 <C> int
GanttIncorrectDependencies
[1]
Which dependencies are marked as incorrect.
0 - none
1 - only dependencies with start
before end (it means that default dependency
float is
empty = unlimited), see also
GanttStrict.
2 -
also dependencies with start
after end (it means that default dependency dependency
float is
0 = strict).
Incompatible with dependencies attached to summary tasks.
new 6.3 chg 10.00 <C> int
GanttStrict
[1] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
Since 10.0. the dependencies correcting algorithm has changed!
How it behaves when correcting dependencies, both ways, manual and automatic correcting.
The behaviors are described for GanttDirection='0'. For opposite direction the mentioned move direction, constraints and dependencies are reversed.
0 | Minimal move (changed 10.0) The first tasks (without incoming dependencies) are moved left as little as possible, only due this or next tasks constraints.
The next tasks are moved left only to correct dependencies, the next tasks need not be close to their ancestors, except GanttIncorrectDependencies is '2' or '3'.
|
1 | Strict move (changed 10.0) Forces all first tasks (without incoming dependencies) to start directly on GanttBase, GanttMinStart or end on GanttMinEnd.
If no such constraint is defined, the first task is moved left as little as possible, only due this or next tasks constraints.
All next tasks are moved left or right to be as close as possible to their ancestors and to not violate any dependency or constraint.
|
2 | For backward compatibility only, since 10.0. use GanttManual instead.
(new 9.1) Like 1, but adds GanttMinStart constraint before every task and moves it with the task when moved manually. Behavior similar to MS Project auto schedule.
It forces setting GanttUseConstraints to at least 1, but always permits moving tasks before GanttMinStart constraint.
It is not required to define the GanttMinStart column. It is possible also to hide the constraints by GanttShowConstraints='0'.
To not set up the min start constraint on start, set <C GanttMinStart="" ... /> to the Gantt column. In this case the min start will be set only on manual change of the task start.
You can also predefine the initial constraint only for particular task by <I xxxGanttMinStart='...'/>, where the xxx is the Gantt column name.
|
3 | Minimal strict move (new 10.0) The first tasks (without incoming dependencies) are moved left as little as possible, only due this or next tasks constraints.
All next tasks are moved left or right to be as close as possible to their ancestors and to not violate any dependency or constraint.
|
new 10.00 <C> bool
GanttDirection
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If the tasks (moved when correcting dependencies) are scheduled to start on GanttBase or finish on GanttFinish.
0 | Schedule from project start (GanttBase). It moves the tasks to the left constraint and next moves them right to correct their dependencies.
If there is no left constraint (GanttBase, GanttMinStart, GanttMinEnd, GanttManual), the task is not moved left, only right. |
1 | Schedule from project finish (GanttFinish). It moves the tasks to the right constraint and next moves them left to correct their dependencies.
If there is no right constraint (GanttFinish, GanttMaxStart, GanttMaxEnd, GanttManual), the task is not moved right, only left. |
new 6.3 <C> int
GanttCorrectDependencies
[2] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If and how will be updated incorrect dependencies between tasks after task resize, move or dependency change.
The automatic correction moves the previous and next tasks, it never resizes tasks and never changes dependency.
If set and a user deletes task containing dependencies, they are deleted too.
0 - no,
1 - automatic update all dependent tasks,
2 - ask user
If Gantt chart contains some dependency errors already on start, they are not affected by this setting, you can correct them in API event like:
Grids.OnReady = function(G){ G.ActionCorrectAllDependencies(); }
new 10.0 <C> string[ ]
GanttCorrectDependenciesButtons
["Yes,No,Always,Never"]
Comma separated names of buttons in the dialog about correcting dependencies.
Can contain the keywords
Yes,
No,
Always,
Never, in any count and order. The button texts are defined in Text.xml.
Yes corrects the dependencies,
No does nothing,
Always correct dependencies and sets GanttCorrectDependencies='1' and
Never only sets GanttCorrectDependencies='0'.
new 6.3 <C> bool
GanttCorrectDependenciesFixed
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
When automatically correcting dependencies after a task is moved or resized, for
1 it never moves this task, rather moves all the other tasks instead to correct the dependencies.
For
0 it works the same as manual correcting dependencies and can also move the changed task.
new 14.0 <C> int
GanttCorrectDependenciesCreate
[2]
Which task to fix if set GanttCorrectDependenciesFixed='1' and dependencies are automatically corrected after new dependency is created by dragging.
0 - none,
1 - ancestor,
2 - descendant.
new 7.0 <C> bool
GanttFixComplete
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If set, only not yet started tasks will be automatically corrected. The tasks with Complete>0 will behave like with Early and Late Start constraints on its start date.
After change by API call GanttRefreshDependencies(
2)
new 13.3 upd 15.1 <C> int
GanttCorrectExclude
[0]
If set to
1, it schedules tasks on excluded dates more precisely, especially milestones on excluded edges. Can be slower than standard scheduling.
Since 15.0 it can be set to values
2,
3,
4 for different solutions of scheduling tasks on different excludes.
new 10.0 <C> int
GanttRunCorrectBox
[0]
How will be moved individual Run boxes when correcting dependencies and
GanttTask contains "Box",
0 - the boxes will be moved independently on the others, the boxes can overlay as Error boxes.
1 - the boxes will be moved independently on the others, but the boxes cannot overlay - if the boxes overlay, the other boxes are moved.
2 - the boxes cannot change their order, if the box is moved, all other boxes in its way are moved too. Empty spaces are
not preserved. Like Adjust
Shrink. Note, here the wrong box order can cause the dependencies cannot be corrected.
new 7.0 chg 10.0 <C> bool
GanttRunCorrectFixed
[1]
Used when correcting dependencies. For
1 it will check the run box moving possibility (fixed boxes) like any other constraints.
Since 10.0 the default value is
1.
Set it to
0 if you use long runs without fixed boxes and the whole run is Gantt task, just to speed up the correcting.
new 9.1 <C> int
GanttMaxCorrectingLoops
[40]
Maximal count of loops when correcting dependencies.
Increase this value if the Gantt chart does not correct the dependencies even if there are no circular dependencies and restricting constraints.
Decrease this value if the Gantt chart is slow when correcting dependencies when contains circular dependencies or restricting constraints that prevent correcting.
new 10.0 <C> int
GanttRunMaxCorrectingLoops
[5]
Maximal count of loops when correcting dependencies for
GanttRunCorrectBox 1 or
2.
new 9.2 <Cfg> int
SortRanges
[0]
Cfg attribute! If set to
1, it sorts all Range cell values when changed. It ensures the dependency values will be always in the same order and the same dependency will not be marked as changed when modified.
If set to
2, it sorts also the original value of range cells, only for comparing if changed.
To use it for dependencies, set also the GanttDescendants / GanttAncestors columns with
Range='1'.
deleted 6.4 <C> string
GanttDependencyObjects
["Main"]
Replaced by
GanttTask.
Comma separated list of Gantt objects where can be attached dependencies (and the objects can be also moved to correct them). Case insensitive.
Permitted objects are
Main,
Run.
If cell contains more of these objects, the first existing one from this list will be used.
new 6.3 upd 10.0 API method void
CorrectDependencies
(TRow row, string col, type bar = null)
Corrects all dependencies related to the given Gantt task.
bar (since 10.0) is main bar plan or run box id or '-' for run bar. If it is null, checks all tasks in the cell.
Only when set
GanttCorrectDependencies (shows also confirm message for value 2).
Call it after some Gantt source that affects dependencies is changed in another way than direct user interaction or edit.
new 6.4 chg 10.0 API method object[ ]
GetIncorrectDependencies
(string col = null)
Since 10.0 the returned array structure remarkably changed!
Returns array of all incorrect dependencies in grid.
col is Gantt column.
The array items are also arrays with these items [source_row, dest_row, shift, source_bar, dest_bar].
The
shift is required shift of the destination task, positive to right, negative to left.
The value should be ignored if the dependent tasks are on different excludes!
The
_bar is the main bar plan or run box id or '-' for run bar.
new 7.1 chg 10.0 API method object[id]
GetTasksToSchedule
(TRow row = null, string col = null, type bar = null, type[][] tasks = null)
Since 10.0 the returned array structure remarkably changed!
Returns array of tasks to be scheduled (moved) to satisfy the dependencies and constraints.
The returned array has such structure:
{ id1: [row1,bar1,move1,left1,left1], id2: [row2,bar2,move2,left2,left2], ... }
idX is the id of the bar and row as "bar@rowid"; where bar is main bar plan (0 for the first), or run box id or '-' for run bar.
rowX is the row object
baxX is the main bar plan or run box id or '-' for run.
moveX is the expected move of the task in milliseconds, negative to the left, positive to the right. The holidays are excluded.
minX is the maximal possible move due left constraints, negative to the left, positive to the right. The holidays are excluded.
maxX is the maximal possible move due right constraints, negative to the left, positive to the right. The holidays are excluded.
It returns the tasks according to the actual scheduling settings (
GanttDirection,
GanttStrict,
GanttIncorrectDependencies (only 0 vs. 1/2/3),
GanttFixComplete,
GanttBase,
GanttBasePreferred,
GanttUseConstraints),
you can temporary change these settings to get differently scheduled tasks.
It is not possible to temporary change the individual task dates, constraints or dependencies to change behavior of this method.
If set
row (and optionally
bar) and
GanttCorrectDependenciesFixed = 1, this tasks is scheduled to not move (to move all other dependent tasks instead).
The
col is the Gantt column, if not set, it is the first Gantt column in the chart.
The
tasks is an array of tasks to schedule as
[[row1,bar1],[row2,bar2],...]. If not set and
row is set, it schedules all tasks dependent on the
row. If set neither
row nor
tasks, it schedules all tasks in the chart.
new 16.2 API method object[]
GetRoutes
(int type, string col = null)
Returns routes of tasks connected by dependencies in 3D array as
[[[row11,plan11],[row12,plan12],[row13,plan13],...],[row21,plan21],[row22,plan22],[row23,plan23],...],...]
where plan is number for main bar plan or "-" for run bar, or string as run box id.
type&
1 =
0 - returns all routes,
1 - returns only the longest routes.
type&
2 =
0 - returns all routes,
2 - returns only critical routes (routes with all tasks with zero Slack).
type&
4 =
0 - the tasks in routers are from first to last,
4 - tasks in routes are reversed from last to first.
type&
8 =
8 - ignores rows with children.
type&
16 =
16 - ignores GanttSummary / GanttRunSummary tasks.
new 6.7 chg 11.0 API event int
OnCorrectDependencies
(TGrid grid, object[id] A, TRow[] R, int error, TRow row, string col, bool slack)
Since 10.0 the parameters and array structure remarkably changed!
Called when dependencies are being corrected.
A is array of objects with expected (but not yet done) move, it has such structure:
A = { id1: [row1,bar1,move1,left1,right1], id2: [row2,bar2,move2,left2,right2], ... }
idX is the id of the bar and row as "bar@rowid"; where bar is main bar plan (0 for the first), or run box id or '-' for run bar.
rowX is the row object.
baxX is the main bar plan or run box id or '-' for run.
moveX is the expected move of the task in milliseconds, negative to the left, positive to the right. The holidays are excluded.
minX is the maximal possible move due left constraints, negative to the left, positive to the right. The holidays are excluded.
maxX is the maximal possible move due right constraints, negative to the left, positive to the right. The holidays are excluded.
It is possible to delete old or add new items into the
A, to move another tasks.
The
R is array of all row objects that are checked in the group:
R = [[row1,bar1],[row2,bar2],...]. Do
not modify this array.
(Since 11.0) The
slack is set when calculating critical path.
error is
null if the dependencies cannot be corrected due circular relation.
1 if there are some tasks to move to correct dependencies or constraints.
2 if some dependencies cannot be corrected due constraints.
Return the
error or new error value.
Since 11.0. return
undefined to ignore the event handler.
new 7.1 API event bool
OnCorrectDependenciesStart
(TGrid grid, object[id] A)
Since 10.0 the parameter array structure remarkably changed!
Called before the dependencies are corrected.
Return true to cancel the correcting.
The
A is array with all errors to correct, see
OnCorrectDependencies.
new 7.1 API event bool
OnCorrectDependenciesFinish
(TGrid grid, object[id] A, bool deperr, bool consterr)
Since 10.0 the parameter array structure remarkably changed!
Called after the dependencies are corrected.
Return true to
not show any message when set
deperr or
consterr.
deperr is set if there are some dependency errors that cannot be corrected due circular relation,
consterr is set when there are constraint errors that cannot be corrected.
The
A is array with all errors to correct, see
OnCorrectDependencies.
new 6.3 formula int
ganttdependencyerrors
(string ganttcol, bool text = 0)
Returns count of all incorrect dependencies in chart.
For
text = 1 returns the whole text like "3 incorrect dependencies".
new 6.0 <Actions>
CorrectAllDependencies
Not attached to any event
Corrects all incorrect dependencies by moving the task to future or to past.
The dependency is incorrect if the source date plus lag is after the destination date or before the destination date plus float.
The result of the call should be Gantt chart without any incorrect dependencies (all in blue).
This method does not solve circular dependencies, in this case some dependencies can be left incorrect.
new 6.3 <Actions>
CorrectDependencies ...FA
Not attached to any event
Corrects dependencies related to the actual or focused row. It can move all the tasks except the actual or focused one.
Schedule algorithm for correcting dependencies
The algorithm changed since 10.0.
The correcting routine moves tasks to satisfy their dependencies and constraints. The tasks are never resized. The dependencies and constraints are never modified. The tasks are always moved as little as possible.
The correcting dependencies can be run:
Both the ways (automatic & manual) should lead to the same results except with settings
GanttCorrectDependenciesFixed='1', because automatic schedule does not move the actual task in this case.
The automatic correcting is run only for the group of tasks where the change happened, see point
1.
1) The tasks are split to groups according to their dependencies. All tasks in group are dependent only on tasks in this group.
The correcting is run independently for the individual groups.
If some group cannot be corrected because of circular dependencies, the whole group is remain unchanged, but the other groups are corrected normally.
2) All the tasks are moved to satisfy constraints:
If set
GanttStrict='0', the tasks are moved as little as possible to satisfy their constraints.
If set
GanttStrict='1' and
GanttDirection='0', all tasks are moved to start on
GanttMinStart,
GanttBase or
GanttManual or to end on
GanttMinEnd.
If set
GanttStrict='1' and
GanttDirection='1', all tasks are moved to end on
GanttMaxEnd,
GanttFinish or
GanttManual or to start on
GanttMaxStart.
If set
GanttStrict='3' and
GanttDirection='0', the first tasks (without incoming dependencies) are moved to start on
GanttMinStart,
GanttBase or
GanttManual or to end on
GanttMinEnd. Other tasks are moved as little as possible to satisfy their constraints.
If set
GanttStrict='3' and
GanttDirection='1', the last tasks (without outgoing dependencies) are moved to end on
GanttMaxEnd,
GanttFinish or
GanttManual or to start on
GanttMaxStart. Other tasks are moved as little as possible to satisfy their constraints.
If the task cannot satisfy all its constraints, the constraints are used in this order:
if set
GanttDirection='0':
GanttDisabled,
GanttBase (if
GanttBasePreferred='1'),
GanttFinish (if
GanttFinishPreferred='1'),
GanttMinStart,
GanttMaxEnd,
GanttMaxStart,
GanttMinEnd,
GanttManual,
GanttBase,
GanttFinish.
if set
GanttDirection='1':
GanttDisabled,
GanttFinish (if
GanttFinishPreferred='1') ,
GanttBase (if
GanttBasePreferred='1') ,
GanttMaxEnd,
GanttMinStart,
GanttMinEnd,
GanttMaxStart,
GanttManual,
GanttFinish,
GanttBase.
Setting
GanttMinStart and
GanttMaxStart to the same date will create
mandatory start and it forces the task to start at this date except it violates another more preferred constraint.
Setting
GanttMinEnd and
GanttMaxEnd to the same date will create
mandatory end and it forces the task to start at this date except it violates another more preferred constraint.
3) Tasks are moved in one direction to satisfy their dependencies.
If set
GanttDirection='0', all descendant tasks are moved
right.
If set
GanttDirection='1', all ancestor tasks are moved
left.
All the applicable constraints are tested and never violated. The dependencies that cannot be satisfied due constraint are left unchanged.
The dependency is satisfied if its
start +
lag >=
end AND
start +
lag +
float <=
end. If the dependency float is not set in the dependency definition, it is controlled by
GanttIncorrectDependencies value.
4) Tasks are moved in opposite direction than in point
3 to satisfy remaining dependencies.
If set
GanttDirection='0', all ancestor tasks are moved
left.
If set
GanttDirection='1', all descendant tasks are moved
right.
All the applicable constraints are still tested and never violated. The dependencies that cannot be satisfied due constraint are left unchanged.
If there is found circular dependency relation, all changes are rolled back and the group is marked as wrong. There is shown alert "It is not possible to correct the dependencies!".
If there is left any incorrect dependency after schedule, there is shown alert "Not all dependencies were corrected due constraints!"
Project date constraints
Here are described project constraints
(base) start date and
finish date that can be changed by a user and are used in dependency and slack calculations.
For maximal and minimal bounds in the whole chart see
Chart size limits - especially
GanttChartMinStart and
GanttChartMaxEnd.
new 6.3 <C> string
GanttBase
Can be uploaded to server
Start date of the whole project. The tasks should not start before this date.
Can be set to date string in English notation or to count of milliseconds. For API is always converted to count of milliseconds since 1/1/1970.
new 6.6 <C> string
GanttFinish
Can be uploaded to server
Finish date of the whole project.
When not set (by default) the finish date is the finish date of the most right task.
It is used to calculate tasks slack.
The end date can be last date or last unit, depending on
GanttLastUnit (new in 8.1).
new 6.4 <C> bool
GanttBaseProof
Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If set to
1, the tasks or constraints cannot be moved or created before
GanttBase.
new 7.0 <C> bool
GanttFinishProof
Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If set to
1, the tasks or constraints cannot be moved or created after
GanttFinish.
new 6.4 <C> bool
GanttBasePreferred
Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
Used when
GanttBase conflicts with task constraints. For
0 it has less priority, for
1 it has higher priority than all task constraints.
new 7.0 <C> bool
GanttFinishPreferred
Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
Used when
GanttFinish conflicts with task constraints. For
0 it has less priority, for
1 it has higher priority than all task constraints.
new 11.0 <C> bool
GanttCorrectOutsideBounds
Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If set, permits moving tasks outside
GanttFinish or
GanttBase during scheduling tasks to correct their dependencies.
Ignored if set
GanttFinishProof or
GanttBaseProof for given scheduling direction.
new 6.6 upd 10.0 <C> int
GanttBaseCanEdit
[1]
If the project start date can be changed by a user.
(Since 10.0) If set to 3, the date is editable and can be set also to excluded dates.
new 6.6 upd 10.0 <C> int
GanttFinishCanEdit
[1]
If the project finish date can be changed by a user.
(Since 10.0) If set to 3, the date is editable and can be set also to excluded dates.
new 6.6 chg 10.0 <C> int
GanttShowBounds
[1/2]
If the project start date and finish date will be shown in the chart as vertical line.
Default value is
1 if the Gantt contains GanttDescendants or GanttAncestors or
2 (since 10.0) if not.
new 7.0 <C> int
GanttUseConstraints
[2]
If and when the constraints and bounds will be used.
0 - Completely ignored, use to temporary disable the constraints, but let them to be still displayed
1 - Used only when moving objects while correcting dependencies
2 - Used also when moving, adding and resizing Gantt task listed in
GanttTask.
3 - Used also when moving, adding and resizing any object (main bar, milestone, run, flag, point). The MaxStart and MinEnd are ignored for other objects than main bar.
new 10.0 <C> string
GanttBaseTip
Tip string shown for the GanttBase line. It can show also the specials:
*Start* - start date of the line,
*End* - end date of the line, if any.
To dynamically generate the tip text use
OnGanttTip API event.
new 10.0 <C> string
GanttBaseAutoTip
Tip string shown for the project auto start line if not defined GanttBase. It can show also the specials:
*Start* - start date of the line,
*End* - end date of the line, if any.
To dynamically generate the tip text use
OnGanttTip API event.
new 10.0 <C> string
GanttFinishTip
Tip string shown for the GanttFinish line. It can show also the specials:
*Start* - start date of the line,
*End* - end date of the line, if any.
To dynamically generate the tip text use
OnGanttTip API event.
new 10.0 <C> string
GanttFinishAutoTip
Tip string shown for the project auto finish line if not defined GanttFinish. It can show also the specials:
*Start* - start date of the line,
*End* - end date of the line, if any.
To dynamically generate the tip text use
OnGanttTip API event.
new 6.6 API method int
GetGanttBase
( )
Returns
GanttBase if set, otherwise returns automatically calculated start date as the start of the most left task.
new 6.3 chg 7.0 API method bool
SetGanttBase
(type date, int action = 2, string col = null)
Changes the
GanttBase date. The
date can be date string in English notation, Date object or count of milliseconds.
The
col is Gantt column, if missing, it used the first Gantt column in grid.
Since 7.0 it does
not change the GanttBase if it is outside chart constraints and returns false for the error.
action is action done after change:
1 | only visually changes the project start |
2 | corrects positions of all tasks to be consistent with the new GanttBase (it corrects also all other dependency errors) |
3 | moves all tasks for the exact difference between old and new date, does not preserve any constraints or dependencies |
new 6.6 API method int
GetGanttFinish
( )
Returns
GanttFinish if set, otherwise returns automatically calculated finish date as the end of the most right task.
new 6.6 chg 7.0 API method bool
SetGanttFinish
(type date, string col = null)
Changes the
GanttFinish date. The
date can be date string in English notation, Date object or count of milliseconds.
The
col is Gantt column, if missing, it used the first Gantt column in grid.
Recalculates slacks and critical path
Since 7.0 it does
not change the finish if it is outside chart constraints and returns false for the error.
new 10.0 API event bool
OnGanttLineChange
(TGrid grid, int index, int date1, int date2, string class, bool edit, int odate1, int odate2, string oclass, bool oedit)
Called before change of any Gantt line. Called from
SetGanttLine method.
index is line position from 0 in
GanttLines,
date1 and
date2 are line new dates as count of milliseconds since 1/1/1970.
class and
edit are new line values.
odate1,
odate2,
oclass and
oedit are actual values of the line.
It is called also for change of
GanttBase with
index =
-1 and for
GanttFinish with
index =
-2.
Return
true to suppress the change.
new 10.0 API event void
OnGanttLineChanged
(TGrid grid, int index, int date1, int date2, string class, bool edit, int odate1, int odate2, string oclass, bool oedit)
Called after change of any Gantt line. Called from
SetGanttLine method. See parameters in
OnGanttLineChange.
new 10.0 <Actions>
MoveGanttLine
Attached to OnDragGantt, cannot be attached anywhere else
Moves Gantt line under mouse cursor by mouse dragging. Used for
GanttLines,
GanttBase and
GanttFinish lines.
new 7.0 deleted 10.0 <Actions>
MoveGanttBase
Replaced by
MoveGanttLine.
new 7.0 deleted 10.0 <Actions>
MoveGanttFinish
Replaced by
MoveGanttLine.
new 6.6 <Actions>
DeleteGanttBase
Attached to OnCtrlClickGantt event
Deletes or undeletes/sets
GanttBase when clicked above the line.
Undelete means setting it to automatically calculated value.
new 6.6 <Actions>
DeleteGanttFinish
Attached to OnCtrlClickGantt event
Deletes or undeletes/sets
GanttFinish when clicked above the line.
Undelete means setting it to automatically calculated value.
Task date constraints
Top position of the constraint icon is calculated as (
GanttHeight - constraintheight) +
GanttTop, where constraintheight is defined in Grid.css.
new 6.3 <C> <cell> string
GanttMinStart
Gantt source - column name or exact value
Early start. The first possible start date of the task, affects main bar, run bar, flags, points.
The task must not be started before this date.
If the task has no incoming dependency and is set
GanttStrict='1', it should start on this date.
Defining both early and late start on the same date will cause
mandatory start.
new 6.3 <C> <cell> string
GanttMaxStart
Gantt source - column name or exact value
Late start. The last possible start date of the task, affects
only main bar.
The task must not be started after this date.
new 6.3 <C> <cell> string
GanttMinEnd
Gantt source - column name or exact value
Early finish. The first possible end date of the task, affects
only main bar.
The task must not be finished before this date.
Defining both early and late end on the same date will cause
mandatory end.
The end date can be last date or last unit, depending on
GanttLastUnit setting
(new in 8.1).
new 6.3 <C> <cell> string
GanttMaxEnd
Gantt source - column name or exact value
Late finish. The last possible end date of the task, affects main bar, run bar, flags, points.
The task must not be finished after this date.
The end date can be last date or last unit, depending on
GanttLastUnit setting
(new in 8.1).
new 6.4 <C> <cell> string
GanttConstraintsTip
Tip shown on mouse hover the constraint. It can contain HTML code.
It can also show values from other cells in row, set by
*col* where col is the column name.
It can show also the special:
*Text* - show the original constraints tip.
To dynamically generate the tip text use
OnGanttTip API event.
new 7.0 <C> int
GanttShowConstraints
[1]
If the constraints will be displayed in chart as icons.
For
0 the constraints will be hidden and cannot be changed by a user, but can be controlled by API.
For
1 the constraints will be shown and interactive, but the chart will not resize to show them.
For
2 the constraints will be shown and interactive and the chart will resize to show them if required, like for the other Gantt objects.
new 7.0 <C> int
GanttUseConstraints
[2]
If and when the constraints and bounds will be used.
0 - Completely ignored, use to temporary disable the constraints, but let them to be still displayed
1 - Used only when moving objects while correcting dependencies
2 - Used also when moving, adding and resizing Gantt tasks listed in
GanttTask
3 - Used also when moving, adding and resizing any object (main bar, milestone, run, flag, point). The MaxStart and MinEnd are ignored for other objects than main bar.
new 9.1 <C> string
GanttConstraintTipFormat
[ ]
Date format for tip for constraints.
If not set, used format for the constraint column.
Useful especially for constraints created by
GanttStrict='2', because they don't have the column.
new 10.0 <C> <cell> string[ ]
GanttConstraintsIcons
A list of four custom icons for the constraints. In order MinStart, MaxStart, MinEnd, MaxEnd.
Separated by semicolon. The icons are the exact urls of the icon.
The icon can be empty to show default constraint icon.
Hover icons can be set
GanttHoverIcons.
new 10.0 <C> <cell> int
GanttConstraintsTop
Vertical position of all constraints in the cell, in pixels.
If not set, the constraints positions are centered to the first
GanttTask.
deleted 7.0 <C> bool
GanttConstraintsAll
[0]
Replaced by
GanttUseConstraints.
If set to
0, only Gantt tasks listed in
GanttTask cannot be moved outside their constraints.
If set to
1, all objects except run (main bar, milestone, flag, point) cannot be moved outside their constraints.
new 7.1 API event int
OnTestConstraints
(TGrid grid, TRow row, string col, string type, int change, int d1, int d2)
Called to test constraints while moving or resizing some Gantt object except Run. It is
not called while correcting dependencies.
The
type is the object type, lowercase: main, flags, points, constraints, base, finish.
The
change is required change (in milliseconds) due actual constraints (GanttBase, GanttFinish, GanttMinStart, GanttMaxStart, GanttMinEnd, GanttMaxEnd).
The
d1 and
d2 are start and end date of the object (in milliseconds), they can be null for some objects.
Return new change to do due the constraints or the
change or 0 to ignore all constraints.
new 6.4 chg 10.0 API method object[ ]
GetIncorrectConstraints
(string col, int all = 0)
Returns array of all tasks violate their constraints.
col is Gantt column.
all is
0 to return only incorrect tasks (
req is not zero),
1 to return strictly incorrect tasks (
strict is not zero),
2 to return all tasks.
The returned array items are also arrays with these items [row, strict, req, min, max, bar].
row | is the TRow object |
strict | (chg 10.0) is expected shift in ms in actual GanttStrict mode to start/end on the constraint |
req | (chg 10.0) is required shift to satisfy the constraints |
min | (new 10.0) is negative maximal possible left shift to not violate constraints |
max | (new 10.0) is maximal possible right shift to not violate constraints |
bar | (new 10.0) is the main bar plan or run box id or '-' for run. |
new 11.0 API method void
DeleteConstraints
(TRow row, string col)
Deletes all constraints in given Gantt cell.
new 7.0 <Actions>
MoveGanttConstraint
Attached to OnDragGantt, cannot be attached anywhere else
Moves constraint by mouse dragging.
Fails, if mouse is not above constraint or the constraint cannot be moved.
new 6.3 <Actions>
NewGanttConstraint
Not attached to any event
Adds new constraint on mouse position.
It adds the first possible constraint to the place. Tests them in order MaxEnd, MinStart, MinEnd, MaxStart.
new 6.3 <Actions>
DeleteGanttConstraint
Attached to OnCtrlClickGantt event
Deletes the constraint under mouse cursor.
It fails if there is no constraint under mouse cursor.
new 6.3 <Actions>
DeleteGanttConstraints
Not attached to any event
Deletes all constraint in the actual row.
It fails if there is no constraint in the row.
Critical path - Slack (Float)
TreeGrid can fill for every tasks its
slack value - how much can be task moved to future (delayed) to not affect project finish date.
The tasks that cannot be moved at all are
critical and lay on
critical path.
The critical tasks are colored in different color and it is also possible to filter by them to show only the critical path.
The finish date is end date of the most right task or can be defined by
GanttFinish.
If set
GanttDirection='1', the slack is calculated in reversed direction against project start date (
GanttBase).
new 6.6 chg 10.0 <C> type
GanttSlack
[0]
(Since 10.0) Set it to
1 to calculate the slack value and critical path for all tasks in chart (tasks of bars defined in
GanttTask).
It can be set to column name to calculate the slack and show it in this column. If there are more bars in the row, the minimal slack value is shown in the column.
When the row's slack value is less or equal to
GanttMinSlack, the not completed main bar is colored in different color as critical task.
The rows can be also filtered by this value or the value can be used as source for formulas.
The slack is calculated in
GanttDataUnits.
new 6.6 <C> int
GanttMinSlack
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
When the row's slack value is less or
equal to GanttMinSlack, the not completed main bar is colored in different color as critical task.
new 6.6 <C> int
GanttErrSlack
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
When the row's slack value is less than GanttErrSlack, the not completed main bar is colored in different color as error task.
new 6.6 <C> bool
GanttSeparateSlack
[0] Saved to cookies, to avoid it set <Cfg GanttLap='1'/>
If set to 1, calculates finish date and slacks separately for every independent group of related tasks. In this case the
GanttFinish /
GanttBase is ignored.
new 7.0 API method void
RefreshGanttSlack
(bool show = 1, int min = null, int err = null)
Recalculates Slack for all cells and recolors critical path.
min is optionally new value for
GanttMinSlack.
err is optionally new value for
GanttErrSlack.
new 10.0 API method int
GetGanttSlack
(TRow row, string col, string bar)
Returns Slack value for given Gantt cell and bar, as main bar plan or Run box id or '-' for Run. Returned value is in milliseconds.
This function cannot be used in Formula, because the Slack is calculated after the Formulas are calculated. To set Slack to some cell use OnGanttSlack instead.
new 10.0 API event int
OnGanttSlack
(TGrid grid, TRow row, string col, string bar, int value, int old, bool show)
Called after every change of calculated slack value.
row,
col is the Gantt cell,
bar main bar plan or Run box id or '-' for Run.
value is new slack value in milliseconds,
old is previous slack value in milliseconds.
show is
1 if expected to refresh the slack cell, if used to write to value to some cell.
Return new value to change the slack or null for default value.
It is possible to use this event to show the Slack value in some cell. For example fill the main bar plans 0 and 1 to columns named 'SLACK' and 'SLACK1':
Grids.OnGanttSlack = function(G,row,col,bar,val,old,show){
if(bar==0) { row.SLACK = val/G.GanttUnitsDuration(); if(show) G.RefreshCell(row,"SLACK"); }
if(bar==1) { row.SLACK1 = val/G.GanttUnitsDuration(); if(show) G.RefreshCell(row,"SLACK1"); }
}