TreeGrid v6.6
Gantt compute
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)
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.
Baseline – base start date of the whole project, no task should start before this date, all first tasks should start on this date.
Date constraints – early start, late start, mandatory start, early end, late end, mandatory end – maximal and minimal end and start date of the task
Base units for calculations and duration
<C> string GanttDataUnits [‘d’] chg 6.3;upd.6.6.
Base unit time for Gantt data lengths, namely for attributes GanttDuration, GanttRun and GanttDependencyLags.
If not set, the values are in milliseconds.
If set GanttExclude, 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 Sunday), ’w1’ – weeks (starting by Monday, in Hirji starts by Saturday),
’M’ - months, ’M3’ – quarters of year, ’M6’ – halves of year, ’y’ – years
The “ms” units can be used for any integer values, not only dates.
<C> string GanttDataModifiers [‘’] new 6.3 .
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.
<C> bool GanttEndLast [1] new 6.3 .
If set to 1, ending date (GanttEnd, second date in Flow or Run) means the last included date.
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’.
Dependencies between tasks - lines and arrows between main bars, milestones, run or flow
The dependencies are defined in GanttDescendants as next dependencies or in GanttAncestors as previous dependencies or in both (they are mirrored).
Since 6.3 the dependencies can be connected also to Run or Flow, see GanttDependencyObjects.
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.
<C><cell> string GanttDescendants Gantt source – column name or exact value new 6.3 .
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 and float. The complete format is idtype+/-lag!float
Type sets edges of task connected, possible dependency types: SS (start->start), SF (start->end) FS (end->start, default), FF (end -> end)
Lag is reserved time between end of task (GanttEnd) and dependency start, in GanttDataUnits or with time unit character like +3d is three days. The default value of lag is 0.
Float is maximal permitted time between dependency start and dependency end, in GanttDataUnits. 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.
Example: 10; 11ss; 12+3; 13ff-1d; 14+22h!; 15sf-4!2 means in full notation: 10fs+0!0; 11ss+0!0; 12fs+3!0; 13ff-1d!0; 14fs+22h!; 15sf-4!2
Since v6.3 replaces Dependencies, DependencyTypes and DependencyLags
<C><cell> string GanttAncestors Gantt source – column name or exact value new 6.3 .
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.
<C><cell> string GanttDependencies Gantt source – column name or exact value deleted 6.3.
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.
<C><cell> string GanttDependencyTypes [“fs”] Gantt source – column name or exact value deleted 6.3.
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)
<C><cell> string GanttDependencyLags [0] Gantt source – column name or exact value deleted 6.3.
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.
<C> bool GanttAllDependencies [1] new 6.6 .
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.
<C> bool GanttDeleteDependencies [0] new 6.7 .
If set to 1 and a user deletes row, all dependencies to and from the row task will be deleted too.
<C> bool GanttDragDependenciesAlways [0] new 7.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.
<Actions> DragGanttDependency Attached to OnDragGantt, cannot be attached anywhere else .
Connects Gantt chart row with another row by dependency line, by mouse dragging. It can be used only for OnDragGantt event.
Connects always from the first Main bar to the second Main bar.
When dependency types (ss,sf,fs,ff) are permitted, 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 one dependency line ending under mouse cursor. The dependency is under mouse cursor only next to the Main bar.
If there are more dependencies under mouse cursor, first are deleted incoming dependencies and if no incoming dependency under mouse cursor, the outgoing dependencies are deleted. Other order is not specified.
It fails if there is no dependency ending (start or end) is under mouse cursor
<Actions> DeleteGanttDependencies ...F Attached to OnCtrlClickGantt 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.
<Actions> EditGanttDependencyLag Attached to OnDblClickGantt event new 6.0 .
Lets a user to edit value of dependency lag. A user must click to start of dependency near to (but not to) main bar.
By default is the action attached to event OnDblClickGantt (double click to Gantt cell).
It fails if there is no dependency start under mouse cursor.
<C> int GanttIncorrectDependencies [1] new 6.3 .
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 float is 0 = strict)
This value is temporary set to 0 if units for compute exclude reach GanttMaxExclude count (due too low zoom level).
After change by API call GanttRefreshDependencies(2)
<C> bool GanttStrict [1] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3 .
How it behaves when correcting dependencies, both ways, manual and automatic correcting.
0 Restricts tasks to not start before GanttBase, but even the first tasks can start later.
The tasks need not be close to their ancestors.
1 Forces all first tasks (without incoming dependencies) to start directly on GanttBase or at GanttMinStart.
All next tasks are moved left as much as possible to be as close as possible to their ancestors.
<C> int GanttCorrectDependencies [2] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3 .
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(); }
<C> bool GanttCorrectDependenciesFixed [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3 .
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.
<C> int GanttCheckDependencies [2] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3;upd 6.7.
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
<C> bool GanttFixComplete [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 7.0.
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)
<C> string GanttDependencyObjects ["Main"] deleted 6.4 .
Replaced by GanttObject.
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, Flow, Run.
If cell contains more of these objects, the first existing one from this list will be used.
API method void CorrectDependencies (TRow row, string col) new 6.3 .
Corrects all dependencies related to the given cell, only when set GanttCorrectDependencies (shows also confirm message for value 2).
Call it after some Gantt source, that affects dependencies, changes in another way than direct user interaction or edit.
API event bool OnCheckDependencies (TGrid grid, TRow row, string col, string newval) new 6.3 .
Called to check newly created dependency by dragging.
Return false to not create the dependency.
newval is new value for the Gantt dependency, it contains all dependencies for the cell, col is Gantt column.
API method object[] GetIncorrectDependencies (string col = null) new 6.4 .
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_strict, shift].
The shift_strict is expected shift in ms in GanttStrict mode, the shift is expected shift without strict mode. The shift can be 0.
API method object [id] GetTasksToSchedule (TRow row = null, string col = null, TRow [] tasks = null) new 7.1 .
Returns array of tasks to be scheduled (moved) to satisfy the dependencies and constraints.
The returned array has such structure: { id1: [row1,move1], id2: [row2,move2], ... }
Where the idX is the id of the row, rowX is the row object and moveX is the expected move of the task in milliseconds, positive to the left, negative to the right. In the moveX are holidays excluded.
It returns the tasks according to the actual scheduling settings (GanttStrict, GanttIncorrectDependencies, 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 use in this method.
If set row 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. 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.
API event bool OnCorrectDependencies (TGrid grid, object[id] A, TRow[] R, bool error ) new 6.7.
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,move1], id2: [row2,move2], ... }
Where the idX is the id of the row, rowX is the row object and moveX is the expected move of the task in milliseconds, positive to the left, negative to the right. In the moveX are holidays 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,row2, ...]. Do not modify this array.
error is set when the dependencies cannot be corrected.
Return false when the tasks cannot be corrected.
API event bool OnCorrectDependenciesStart (TGrid grid, object[id] A) new 7.1.
Called before the dependencies are corrected.
Return true to cancel the correcting.
The A is array with all errors to correct, see OnCorrectDependencies.
API event bool OnCorrectDependenciesFinish (TGrid grid, object[id] A, bool deperr, bool consterr) new 7.1.
Called after the dependencies are corrected.
Return true to show any message when set deperr or consterr.
deperr is set if there are some dependency errors that cannot be corrected, consterr is set when there are constraint errors that cannot be corrected.
The A is array with all errors to correct, see OnCorrectDependencies.
formula int ganttdependencyerrors (string ganttcol, bool text = 0) new 6.3 .
Returns count of all incorrect dependencies in chart.
For text = 1 returns the whole text like “3 incorrect dependencies”
<Actions> CorrectAllDependencies Not attached to any event new 6.0 .
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.
<Actions> CorrectDependencies ...F Not attached to any event new 6.3 .
Corrects dependencies related to the actual or focused row. It can move all the tasks except the actual or focused one.
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 automatically after user change in the Gantt chart or manually by clicking to Correct dependencies icon on toolbar (first icon) or by API. If the automatic correcting is run is controlled by GanttCorrectDependencies attribute.
Both the ways (automatic & manual) should lead to the same results except with settings GanttCorrectDependenciesFixed=’1’, see the point 5.
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 their date constraints (GanttMinStart, GanttMaxStart, GanttMinEnd, GanttMaxEnd) and base line (GanttBase). The GanttBase is used only if GanttMinStart is not set.
If set GanttStrict, the first tasks (without incoming dependencies) are forced to start on GanttMinStart or GanttBase except it violates the other constraints.
If the task cannot satisfy all the constraints. the constraints are used in this order: MinStart, MaxEnd, MaxStart, MinEnd.
Setting GanttMinStart and GanttMaxStart to the same date will create mandatory start and it forces the task to always start at this date. The same for mandatory end (with lower priority than mandatory start).
3) All tasks are moved to the left to satisfy their dependencies.
The task constraints are tested and never violated, except the GanttStrict constraint (see point 2).
The dependencies that cannot be satisfied due constraint are left unchanged.
If set GanttStrict, all dependencies are used like they have float = 0 (means to not have any space between dependency start+lag and end), except the task move would violate another incoming dependency.
4) All tasks are moved to the right to satisfy the remaining dependencies.
The task constraints are still tested and never violated, except the GanttStrict constraint (see point 2).
The dependency float is always used as is.
If there is left any incorrect dependency after, all changes are rolled back and the group is marked as wrong.
5) If set GanttCorrectDependenciesFixed and the changed task (the task changed by a user when applying automatic correcting) was moved due dependency error, it tries to move all other tasks to the other direction and cancel the move of the changed task.
It still preserves all constraints of all tasks, so this option has sense especially without set GanttStrict.
If there is neither set GanttStrict nor GanttBase, the tasks are moved firstly to the right and secondly to the left, see points 3 and 4.
Here are described project constraints baseline 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 Zoom options – GanttChartMinStart, GanttChartMaxEnd, ...
<C> string GanttBase Can be uploaded to server new 6.3.
Base start date of the whole Gantt chart. 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.
If defined, all dependency corrections move tasks to left, but not before this date.
If not defined, all dependency corrections move tasks always to right.
<C> string GanttFinish Can be uploaded to server new 6.6.
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.
<C> bool GanttBaseProof Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.4 .
If set to 1, the tasks or constraints cannot be moved or created before GanttBase.
<C> bool GanttFinishProof Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 7.0 .
If set to 1, the tasks or constraints cannot be moved or created after GanttFinish.
<C> bool GanttBasePreferred Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.4 .
Used when GanttBase conflicts with task constraints. For 0 it has less priority, for 1 it has higher priority than all task constraints.
<C> bool GanttFinishPreferred Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 7.0 .
Used when GanttFinish conflicts with task constraints. For 0 it has less priority, for 1 it has higher priority than all task constraints.
<C> bool GanttBaseCanEdit [1] new 6.6 .
If the project start date can be changed by a user.
<C> bool GanttFinishCanEdit [1] new 6.6 .
If the project finish date can be changed by a user.
<C> bool GanttShowBounds [1] new 6.6 .
If the project start date and end date will be shown in the chart as vertical line.
It shows GanttBase and GanttFinish and if they are not set, it shows automatically calculated bounds in gray.
API method int GetGanttBase ( ) new 6.6 .
Returns GanttBase if set, otherwise returns automatically calculated start date as the start of the most left task.
API method bool SetGanttBase (type date, int action = 2, string col = null) new 6.3;chg 7.0.
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 baseline if it is outside chart constraints and returns false for the error.
action is action done after change:
1 – only visually changes the base line
2 – corrects positions of all tasks to be consistent with the new baseline (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
API method int GetGanttFinish ( ) new 6.6 .
Returns GanttFinish if set, otherwise returns automatically calculated finish date as the end of the most right task.
API method bool SetGanttFinish (type date, string col = null) new 6.6;chg 7.0.
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 baseline if it is outside chart constraints and returns false for the error.
<Actions> MoveGanttBase Attached to OnDragGantt, cannot be attached anywhere else new 7.0 .
Moves project baseline by mouse dragging.
Fails, if mouse is not above baseline or baseline cannot be moved.
<Actions> MoveGanttFinish Attached to OnDragGantt, cannot be attached anywhere else new 7.0 .
Moves project finish line by mouse dragging.
Fails, if mouse is not above finish line or finish line cannot be moved.
<Actions> DeleteGanttBase Attached to OnCtrlClickGantt event new 6.6 .
Deletes or undeletes/sets GanttBase when clicked above the line.
Undelete means setting it to automatically calculated value.
<Actions> DeleteGanttFinish Attached to OnCtrlClickGantt event new 6.6 .
Deletes or undeletes/sets GanttFinish when clicked above the line.
Undelete means setting it to automatically calculated value.
Note: The MS Project task constraints ASAP (as soon as possible) and ALAP (as last as possible) are implemented for whole project when set GanttStrict=’1’ and GanttIncorrectDependencies=’1’ (ASAP) or ‘2’ (ALAP). Or the settings can be set per task dependency by its Float value, see dependencies.
<C><cell> string GanttMinStart Gantt source – column name or exact value new 6.3 .
Early start. The first possible start date of the task, affects main bar, milestone, and flow.
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.
<C><cell> string GanttMaxStart Gantt source – column name or exact value new 6.3 .
Late start. The last possible start date of the task, affects main bar and milestone.
The task must not be started after this date.
<C><cell> string GanttMinEnd Gantt source – column name or exact value new 6.3 .
Early finish. The first possible end date of the task, affects main bar and milestone.
The task must not be finished before this date.
Defining both early and late end on the same date will cause mandatory end.
<C><cell> string GanttMaxEnd Gantt source – column name or exact value new 6.3 .
Late finish. The last possible end date of the task, affects main bar, milestone and flow.
The task must not be finished after this date.
<C><cell> string GanttConstraintsTip new 6.4 .
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.
<C> int GanttShowConstraints [1] new 7.0 .
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
<C> int GanttUseConstraints [2] new 7.0 .
If and when the constraints 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 GanttObject objects
3 – Used also when moving, adding and resizing any object (main bar, milestone, flow, run, flag, point). The MaxStart and MinEnd are ignored for other objects than main bar.
<C> bool GanttConstraintsAll [0] deleted 7.0 .
Replaced by GanttUseConstraints.
If set to 0, only GanttObject objects cannot be moved outside their constraints.
If set to 1, all objects except run (main bar, milestone, flow, flag, point) cannot be moved outside their constraints.
API event int OnTestConstraints (TGrid grid, TRow row, string col, string type, int change, int d1, int d2) new 7.1.
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, flow, 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.
API method object[] GetIncorrectConstraints (string col) new 6.4 .
Returns array of all tasks violate their constraints. col is Gantt column.
The array items are also arrays with these items [row, shift_strict, shift].
The shift_strict is expected shift in ms in GanttStrict mode, the shift is expected shift without strict mode. The shift can be 0.
<Actions> MoveGanttConstraint Attached to OnDragGantt, cannot be attached anywhere else new 7.0 .
Moves constraint by mouse dragging.
Fails, if mouse is not above constraint or the constraint cannot be moved.
<Actions> NewGanttConstraint Not attached to any event new 6.3 .
Adds new constraint on mouse position.
It adds the first possible constraint to the place. Tests them in order MaxEnd, MinStart, MinEnd, MaxStart.
<Actions> DeleteGanttConstraint Attached to OnCtrlClickGantt event new 6.3 .
Deletes the constraint under mouse cursor
It fails if there is no constraint under mouse cursor.
<Actions> DeleteGanttConstraints Not attached to any event new 6.3 .
Deletes all constraint in the actual row
It fails if there is no constraint in the row.
Exclude - holidays
Ignores or hides non workdays, non working hours or any other dates – for all rows the same
Defined by GanttExclude (date ranges) and GanttExcludeRepeat (intervals).
You can exclude from dependency calculations and task duration any dates or date range like weekends, working hours or any exact custom dates.
The excluded dates can be shown in chart with different background or can be completely hidden.
<C> string GanttExclude Can be uploaded to server new 6.3; upd 7.0.
Date ranges hidden from Gantt chart. The ranges are separated by semicolon, the values by tilde and the repeater by ‘#’.
The format is: repeater1#date1a~date1b#type1;repeater2#date2a~date2b#type2;...
The repeater can be one of GanttDataUnits. If it is missing, the date is not repeated. The date is repeated also before it.
(Since 7.0) The type value is by default empty to standard exclude.
If the type value is set to 0, the defined dates are included instead of excluded, to return some dates to previously excluded ranges.
The items are processed one by one, so if some date is more times excluded and included, the last one result is used.
If the type value is 1 – 5, the dates are excluded and marked by the specified background class.
For example: GanttExclude = ‘w#1/5/2008~1/7/2008; d#00:00~9:00; d#13:00~14:00; d#18:00~24:00’ shows only hours 8:00 – 13:00 and 14:00 – 18:00 and only workdays.
(Since 7.0) It is possible to limit the repeating, when the date range is wider than the repeater, the range is rounded to the repeater range and repeated only between the dates.
For example ‘w#1/5/2008~12/29/2008’ excludes all weekends, but only in year 2008.
(Since 7.0) It is possible to set the second date before the first one, it will be updated to correctly fill the repeat range.
For example ‘d#18:00~8:00’ excludes all times from 18:00 to 8:00.
This value is temporary disabled if units for compute exclude reach GanttMaxExclude count (due too low zoom level).
Remember, excluding too small units (e.g. minutes when chart shows years) can remarkably slow down the Gantt and Exclude calculation, see GanttMaxExclude.
<C> string GanttInclude Can be uploaded to server deleted 7.0.
Replaced by GanttExclude with the third parameter type = 0
<C> bool GanttHideExclude [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3 .
Type of exclude:
0 – displayed – all the dates are displayed, the Exclude is used only to specify correct / incorrect dependencies and when moving bars.
1 – hidden – all ranges from exclude are hidden from chart
It is possible to set different zoom settings for case the Exclude is hidden by items with suffix Ex, like ... GanttWidth:18,GanttWidthEx:22 ...
<C> int GanttCheckExclude [1] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.3 .
If and how will be checked placing start of main bar, milestone, flow and point on holidays. It does not affect run and flag.
0 – place to holiday, 1 – place to the first workday after, 2 - ask user
<C> int GanttMaxExclude [150000] new 6.3 .
Maximal count of units in chart for compute exclude.
The count is computed as (maxdate-mindate) * excludeunits.
The maxdate and mindate depend on the chart content and also on chart round and minimal column width to display.
The excludeunits is the smallest unit used in dates in GanttExclude / GanttInclude. For example GanttExclude=’12:00~13:00’ will be hours, but for ’11:55~12:55’ will be 5 minutes.
Increasing this value can slow down Exclude computation. First check if the excludeunits are not too small.
If the count of the units reaches this limit, Exclude and incorrect dependency checking are temporary disabled.
The default value 150,000 is about 17 years of hours ‘h’ exclude and about 400 years of days ‘d’ exclude.
API method void ChangeExclude (string exclude, string include, int type = 0) new 7.0 .
Changes GanttExclude and GanttInclude to the given values and recalculates Gantt chart.
For type = 0 it recalculates end dates of Main bar and Flow according to their duration.
For type = 1 it recalculates duration of Main bar according to end date. The Flow is not changed.
The Run boxes are recalculated according to their definition, if the boxes are defined by end date or duration.
To let users to change the excluded dates use Dates type Button and call ChangeExclude in cell OnChange event.
API method void SetHideExclude (bool hide) new 6.3 .
Changes GanttHideExclude and refreshes Gantt and zoom.
If hide is null changes the value 0/1
formula int gantthasexclude (string ganttcol) new 6.3 .
Returns 0 if exclude is not defined or temporary disabled, returns 1 if Exclude is shown, returns 2 if Exclude is hidden.
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.
<C> string GanttSlack new 6.6 .
Attribute or column name where the task slack will be stored. If set to column name, the column should be not editable.
When not set, the slack is not computed. Set it only if you need to identify critical task and path, because its calculation slows down the grid.
It can be any string that does not collide with other row attribute names – it is row attribute, not cell attribute.
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.
<C> int GanttMinSlack [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.6 .
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.
<C> int GanttErrSlack [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.6 .
When the row’s slack value is less than GanttErrSlack, the not completed main bar is colored in different color as error task.
<C> bool GanttSeparateSlack [0] Saved to cookies, to avoid it set <Cfg GanttLap=’1’/> new 6.6.
If set to 1, calculates finish date and slacks separately for every independent group of related tasks. In this case the GanttFinish is ignored.
API method void RefreshGanttSlack (bool show = 1, int min = null, int err = null) new 7.0 .
Recalculates Slack for all cells and recolors critical path.
min is optionally new value for GanttMinSlack. err is optionally new value for GanttErrSlack.
Summary tasks are group of tasks and their start, end and duration is summary of its children.
Define the summary task as default row <D> tag with attributes set for the summary task and assign this default by Def attribute, base summary definition can be:
<D Name=”Summary” Calculated=”1” CalcOrder=”Start,End,Duration,Complete”
StartFormula=”ganttstart()” EndFormula=”ganttend()” DurationFormula=”ganttduration()” CompleteFormula=”ganttpercent()”
/>
where Start, End, Duration and Complete are names of the four Gantt source columns, Summary is custom name if this default row.
Remember, the CalcOrder must be set, to calculate the duration after the start and end. If you will have more formulas in the default, you must add these columns to the CalcOrder too.
To calculate Real Flow bars as Real Flow instead of Main bars use sumrange function for the GanttFlow column:
<D Name=”Summary” Calculated=”1” CalcOrder=”Flow,Complete”
FlowFormula=”sumrange()” CompleteFormula=”ganttpercent()”
/>
To calculate Real Flow bars as summary Main bar retype in summary row the attributes for Flow to Main and use standard Summary formulas like:
<D Name="Summary" Calculated="1" CalcOrder="xxxGanttStart,xxxGanttEnd,Complete"
xxxGanttFlow="" xxxGanttFlowComplete="" xxxGanttComplete="Complete"
xxxGanttStartFormula="ganttstart()" xxxGanttEndFormula="ganttend()" CompleteFormula="ganttpercent()"
/>
where xxx is the Gantt column name, the Complete is column where is the GanttFlowComplete set.
You can set different class for the summary bars by GanttClass attribute, for example <D ... xxxGanttClass=”GanttG” xxxGanttIcons=”1”/>, the GanttG is CSS class designed for the summary tasks, xxx is actual Gantt column name in the grid. The GanttIcons show the side icons designed for summary tasks.
The summary tasks are usually expected to be not editable and not movable, for this behavior set <D ... xxxGanttEdit=”” CanEdit=”0”/>
Editable summary tasks
It is possible to have also editable summary tasks, including date constraints and dependencies.
All the dependencies and constraints attached to summary tasks are automatically assigned to all child tasks.
To set the summary task editable define <D xxxGanttEdit=’all’ StartCanEdit=’1’ /> where the Start is name of the Gantt source columns, the xxx is name of the Gantt column itself.
The Flow Summary bars should not be editable (movable), only their dependencies and constraints should be editable <D xxxGanttEdit=’dependency,dependencytypes,dependencylags,constraints’ />
To correctly calculate dependencies and date constraints set <D xxxGanttSummary=’1’/>, see its description below.
<cell> int GanttSummary new 6.7 .
Set to 1 for editable summary tasks. It will cause:
- all dependencies attached to the summary task will be assigned also to all its children (as hidden dependencies)
- dependencies between the summary and its children will be marked or restricted as circular
- the MinStart and MaxEnd date constraints assigned to summary tasks will be used also for all its children if they are be more restrictive than the child task constraints, if any.
- if the tasks is moved by mouse dragging or editing its start date, it moves also all its children. The task cannot be moved, if it would lead to violate of child’s constraints. Only for Main bar.
- the task cannot be created, resized or deleted and its GanttComplete value cannot be changed by a user. Except the GanttSummary is set to 2.
The method implemented causes not good behavior for dependencies incoming to the finish of the summary task and dependencies outgoing from start of the summary task.