TreeGrid v6.3

Run chart

TreeGrid documentation index

 

Run chart is universal chart that displays one or more boxes in one cell. 

Run chart is not Gantt chart used for project management, but supports also all TreeGrid Gantt features like zoom, dependencies, holidays, resources and so on.

In Run chart can be also shown other Gantt objects like flag, main bar, milestone or flow, even in the same cell with Run objects.

 

Run definition

 

The Run is defined by GanttRun (list of individual boxes) and eventually by GanttRunStart (start date).

The run can be defined by one start date and list of widths and types of the individual boxes. The boxes are separated directly one by one, but it supports also empty type for space between boxes.

Or the run can be defined by start dates of individual boxes and their widths or end dates. In this case the empty boxes are automatically added between the boxes.

If the run boxes override each other, they are marked as error and shown in red.

The individual run boxes can have different width, shape, color, caption and tooltip.

 

<C><cell>        string[][] GanttRun                      Gantt source – column name or exact value                  new 6.1 upd 6.2.

Definition of individual Run boxes.

If the boxes have not specified Start date, they are displayed from GanttRunStart one by one, without any space.

The definition of boxes is separated by semicolon, the individual items in the box definition are separated by comma.

The semicolon and comma must not be present in any item text in the range.

It is possible to change the separators by adding the both on start, e.g. “&*3*End*Start&20*Box&&20*Box” uses & as box and * as item separator. To be sure that the separator cannot be included in the run data, you can use any Unicode character as separator, e.g. “&#xF001; &#xF000;3&#xF000;End&#xF000;Start&#xF001;20&#xF000;Box&#xF001; &#xF001;20&#xF000;Box” uses &#xF001; as box and &#xF000; as item separator.

Do not fill any useless white characters (spaces) in the definition!

 

The one box definition is:                 Width,Type,Text,Class,Tip                            Must have set also GanttRunStart as the start of the whole run

OR         Start,Width,Type,Text,Class,Tip                 (new 6.2) Does not support Empty and Nbsp and joined boxes

OR         Start,End,Type,Text,Class,Tip                      (new 6.2) Does not support Empty and Nbsp and joined boxes

All the fields are optional, e.g. “3,End,Start;;5;;3,Solid,End” is the same as “3,End,Start,,;0,Empty,,,;5,Box,,,;0,Empty,,,;3,Solid,End,,”

 

date        Start       (new 6.2) Start date of the task, if used, the GanttRunStart is ignored. Use Start date if the tasks are not continuous. Between tasks will be automatically added the Empty boxes

                               The Start can be count of milliseconds or date string in English format (M/d/yyyy HH:mm:ss or d.M.yyyy HH:mm:ss or yyyy-MM-dd HH:mm:ss)

                               Does not support types Empty and Nbsp and joined boxes.

date        End        (new 6.2) End date of the task, used instead of Width. Use End date if you know the start and end dates instead of duration.

                               The End can be count of milliseconds or date string in English format (M/d/yyyy HH:mm:ss or d.M.yyyy HH:mm:ss or yyyy-MM-dd HH:mm:ss)

                               The End can be the exact end date or the last data unit, according to setting GanttEndLast.

int           Width    width of the box in GanttDataUnits or in milliseconds, used instead of End date. Use Width if you know duration and not end date.

                               The empty space (Type=0) can have negative width for overflowed adjacent boxes, these error boxes are displayed in red

int           Type       feature of the box, default value is Box if Width is set or Empty if Width is not set. Case insensitive keyword, must not contain any spaces.

                               Box                        Normal box. Can be moved or resized by mouse dragging, depending on other settings.

                                                               Can be also moved automatically when other box is resized or moved, depending on other settings.

                                                               To permit moving box from its adjacent sibling, there must be defined Empty space between them (with 0 width).

                               Solid                      Can be moved, but cannot be resized

                               Left                        Fixed left - its start cannot be changed, it can be only resized on right side and cannot be moved

                               Right                     Fixed right - its end cannot be changed, it can be only resized on left side and cannot be moved

                               Fixed                     Fixed both - it cannot be moved or resized

                               Empty                   Empty space between boxes, it is not interactive. Can have also set 0 width, to only separate adjacent boxes, to let them move separately.

                                                               Can be automatically shrunk or enlarged when other box is moved or resized, depending on other settings

                                                               Two adjacent empty spaces are automatically merged together.

                                                               Cannot be used when Start is set for the boxes

                               Nbsp                      Not breakable, not resizable, not interactive empty space between boxes.

                                                               Can be placed only between two boxes to join them. When there is adjacent Empty space, the Nbsp is automatically removed.

                                                               Cannot be used when Start is set for the boxes

                               Bound                   If placed as the first box, it is not resizable, not movable fixed start box and is displayed before the start date.

                                                                              It is not possible to move boxes before or on the fixed start.

                                                               If placed as the last box, it is not resizable, not movable fixed end box.

                                                                              It is not possible to move boxes after or on the fixed end.

                                                               It should not be placed anywhere else.

                               End                        If placed as the first box, it is not resizable, but movable start box and is displayed before the start date.

                                                                              When moving box before or on the start, the start is automatically moved before it.

                                                               If placed as the last box, it is not resizable, but movable end box.

                                                                              When moving box after or on the end, the end is automatically moved after it

                                                               It should not be placed anywhere else.

string     Text       caption displayed on the box, it can contain also these special strings:

                               %d – replaces it by Width displayed as date formatted by GanttRunFormat.

                               %n – replaces it by Width displayed as integer formatted by GanttRunFormat.

string     Class      CSS class used for the box. This class can predefined the shape and color of the box

                               Before the class name is automatically added “GxGanttRun”, where the Gx is style prefix.

                               There are predefined 17 classes for all basic background colors: Aqua, Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Orange, Purple, Red, Silver, Teal, White, Yellow.

string     Tip         tooltip displayed when mouse hovers the box

 

<C><cell>        string    GanttRunStart           Gantt source – column name or exact value                              new 6.1       .

Start date of the Run boxes, usually column name, but can be also date string (M/d/yyyy hh:mm:ss) or count of milliseconds

Used only if the GanttRun does not contain Start dates, but only boxes widths.

Remember, if you define GanttRunStart column, the new boxes are created without Start date in GanttRun.

 

<C> <cell>       string    GanttRunSave           [0]                                                                                          new 6.2       .

Type of GanttRun box attribute structure for save.

0             “Width,Type,Text,Class,Tip” if defined GanttRunStart column or “Start,End,Type,Text,Class,Tip” if not

1             “Width,Type,Text,Class,Tip”

2             “Start,Width,Type,Text,Class,Tip”

3             “Start,End,Type,Text,Class,Tip”

 

<C> <cell>       string    GanttRunFormat                                                                                                   new 6.1       .

Date or number format string (like for Type Date or Int) to display box width in the box caption, see GanttRun, part Text.

 

<C> <cell>       string    GanttRunTip                                                                                                            new 6.4       .

Tip shown on mouse hover the box. It can contain HTML code.

By default it shows the Tip part from GanttRun.

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:

*Text* - show the original box Tip part from GanttRun, *Index* - the box index (from 1, excluding empty boxes)

*Start* - start date of the box, *End* - end date of the box, *Duration* - length of the run in GanttRunFormat or in GanttDataUnits.

Example: “*Index*. box *Start* - *End*&lt;br>*Text*”

 

<C> <cell>       string    GanttRunTipDateFormat                                                                               new 6.4       .

Date format to display Start and End of the run in GanttRunTip *Start* and *End*.

It is the same format as for Date type.

 

Run moving and resizing

 

The run boxes are independent on each other, they can be resizes or moved  individually or together and also it is possible to change their position.

 

<C> <cell>       string[]  GanttRunResize      [“Resize”]                                                                                new 6.1       .

Which boxes can be resized. Comma separated list of flag keywords, case insensitive

empty     When set nothing, resizing is restricted

Resize    Only resizable boxes can be resized

All          All boxes, including solid boxes can be resized

 

There are also attributes read when dragging with appropriate shift key: GanttRunResizeCtrl, GanttRunResizeAlt, GanttRunResizeShift

 

<C> <cell>       string[]  GanttRunMove          [“Slide”]                                                                                   new 6.1       .

How the boxes can be move. Comma separated list of flag keywords, case insensitive

empty     When set nothing, moving is restricted

Slide      The box can be shifted left or right, but cannot change the box order

Move     The moved box will be replaced by empty space

Copy      The moved box will stay on the same position and is duplicated to the new

Remove The moved box will be removed and next boxes will be shifted according to GanttRunRemoveAdjust.

 

All          Also fixed boxes can be moved

Single    Only one box will be moved, when there are more adjacent boxes without separating spaces

 

There are also attributes read when dragging with appropriate shift key: GanttRunMoveCtrl, GanttRunMoveAlt, GanttRunMoveShift

 

<C> <cell>       string[]  GanttRunAdjust       [“Shift”]                                                                                   new 6.1       .

How will be moved next or previous boxes when moving some box. Comma separated list of flag keywords, case insensitive.

The order of applying Error/Resize/Move is set by order of the flag keywords.

 

empty     When set nothing, the box will be moved within surrounding empty space only

Shift       The box will be moved or resized within surrounding empty space and if required, the next or previous boxes will be shifted and their empty spaces preserved.

Shrink   The box will be moved or resized within surrounding empty space and if required, the next or previous boxes will be shifted and their empty spaces shrunk

Slip        The next or previous boxes will be shifted, all empty spaces will be preserved, including the adjacent

 

All          Also fixed boxes will be shifted if required, for Shift/Shrink/Slip

Single    When there are more adjacent boxes without space, the surrounding space will be taken as none, especially for Shift and Slip

                If not present, the surrounding space is taken as the nearest space

Append When dragged to box end, attaches it to the box without space as adjacent – the boxes will be chained.

 

Error    The box will be moved or resized even if there is no room for it, in this case it will be marked as error.

Resize    The box will be resized if there is no room for it

Move     The box will be moved left if there is no room for it (also shifting boxes on left side by Shift/Shrink/Slip will be permitted)

 

There are also attributes read when dragging with appropriate shift key and for specific GanttRunMove / GanttRunResize actions:

GanttRunAdjustCtrl, GanttRunAdjustAlt, GanttRunAdjustShift

GanttRunAdjustResize, GanttRunAdjustResizeCtrl, GanttRunAdjustResizeAlt, GanttRunAdjustResizeShift

GanttRunAdjustSlide, GanttRunAdjustSlideCtrl, GanttRunAdjustSlideAlt, GanttRunAdjustSlideShift

GanttRunAdjustMove, GanttRunAdjustMoveCtrl, GanttRunAdjustMoveAlt, GanttRunAdjustMoveShift

GanttRunAdjustCopy, GanttRunAdjustCopyCtrl, GanttRunAdjustCopyAlt, GanttRunAdjustCopyShift

GanttRunAdjustRemove, GanttRunAdjustRemoveCtrl, GanttRunAdjustRemoveAlt, GanttRunAdjustRemoveShift

If the exact attribute is not set, the universal one is used, e.g. the attributes are read in this order: GanttRunAdjustMoveCtrl, GanttRunAdjustMove, GanttRunAdjustCtrl, GanttRunAdjust

 

<C><cell>        string[][] GanttRunNew           [1,Box]                                                                                    new 6.1       .

One or more boxes that will be created when adding new box to the run, by dragging empty space

It has the same format as GanttRun.

If it contains more boxes, the last one will be resized a user while adding the boxes.

Set it to empty string to forbid adding new boxes.

There are also attributes read when dragging with appropriate shift key: GanttRunNewCtrl, GanttRunNewAlt, GanttRunNewShift

 

<C><cell>        string[][] GanttRunNewStart           [1,Box]                                                                        new 6.1       .

Setting GanttRunNew when adding new box to the empty run, by dragging empty space.

It can contain also some start or end box.

There are also attributes read when dragging with appropriate shift key: GanttRunNewStartCtrl, GanttRunNewStartAlt, GanttRunNewStartShift

 

<C><cell>        string[][] GanttRunTypes      [ ]                                                                                            new 6.1       .

List of predefined types of the boxes to select from popup menu, it has the same format as GanttRun except there is the type name (shown in menu) instead of width as the first item.

The empty values are ignored.

Used to let a user to change the type and class of clicked box from popup menu

For example: “type1,,,Red;type2,,,Blue;type3,solid,xxx,White”

 

<C> <cell>       string[]  GanttRunError                                                                                                         new 6.2       .

How will be the error boxes handled. Comma separated list of flag keywords, case insensitive.

Sort        The boxes will be sorted by its start position, after any change

 

API event         bool      OnGanttRunDrop    (TGrid grid, TRow row, string col, bool drop, object src, int index, string keyprefix, int x, int y, TGrid togrid, TRow torow, string tocol, int cellx)         new 6.1 .

Called during dragging and also when the dragged run box(es) is dropped. It is called also when it is dropped outside any grid.

It is called only for GanttRunMove=’Move/Copy/Remove’

grid, row, col is source run from that is dragged.

drop is false when called during dragging to check if the box can be dropped and true when the box is being dropped.

src is parsed run that is dragged – two dimensional array of the dragged boxes.

index is RunIndex of the dragged box inside its source cell (not in src), if more boxes are dragged together, this is index of the one that was caught by mouse.

keyprefix is prefix of shift keys: “Ctrl”, “Alt”, “Shift”

x, y is mouse position in page in time of drop, in pixels.

togrid, torow, tocol is destination cell to that is dropped. It can be null if dropped outside any grid

cellx is drop position inside the destination cell, in pixels.

Return false to suppress drop

 

Run API and formulas

 

API method     object   GetGanttRun   (TRow row, string col)                                                                         new 6.1       .

Returns parsed GanttRun value for given Gantt cell.

Returned object is two dimensional array with the parsed boxes. The width (first item) are always in pixels. The type (second item) is always set.

It contains also property Start as left position (in pixels) from the cell left edge. Regardless on the first box is start End/Bound type or not.

 

API method     object   SetGanttRun   (TRow row, string col, object run)                                                        new 6.1       .

Writes parsed GanttRun into the Run source cell value for given Gantt cell.

The run must be the object returned from GetGanttRun!  Never create new run object!

You can get the run object by GetGanttRun, modify its individual boxes and / or Start property and set it back by SetGanttRun. Never create new run object!

 

formula            int        ganttrunmaxend     (string ganttcol)                                                                       new 6.1       .

Calculates maximal end date (in milliseconds) of all child Runs.

Used to get Run range of child Runs and show it as Main Bar.

ganttcol – column showing the Gantt chart, it should contain the Run bars.

Example: <I Calculated="1" CalcOrder="GGanttStart,GGanttEnd" GGanttStartFormula="ganttrunminstart('G')" GGanttEndFormula="ganttrunmaxend('G')"/>

 

formula            int        ganttrunend    (string ganttcol)                                                                                   new 6.2       .

Calculates end date (in milliseconds) of one Run.

ganttcol – column showing the Gantt chart, it should contain the Run bars.

 

formula            int        ganttrunminstart     (string ganttcol)                                                                       new 6.2       .

Calculates minimal start date (in milliseconds) of all child Runs.

Used to get Run range of child Runs and show it as Main Bar.

ganttcol – column showing the Gantt chart, it should contain the Run bars.

Example: <I Calculated="1" CalcOrder="GGanttStart,GGanttEnd" GGanttStartFormula="ganttrunminstart('G')" GGanttEndFormula="ganttrunmaxend('G')"/>

 

formula            int        ganttrunstart (string ganttcol)                                                                                   new 6.2       .

Calculates start date (in milliseconds) of one Run.

ganttcol – column showing the Gantt chart, it should contain the Run bars.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.