Level class (Gantt)

Level(oLevels, oLevel)

new Level(oLevels, oLevel)

The Level object describes a level in the chart. The Level(index) method retrieves the level based on its index.

Every option of the LevelOptions type has associated a property of the Level object. For instance, the option:

label {string}, indicates the format to display the level's label
is associated with the property:
Label {string}, indicates the format to display the level's label
which means that the following statements are equivalent:
oLevel.Options = {label: "<%yyyy%>"}
oLevel.SetOptions({label: "<%yyyy%>"})
oLevel.Label = "<%yyyy%>"
oLevel.SetLabel("<%yyyy%>")
where oLevel is an object of Level type
Parameters:
Name Type Description
oLevels Levels Indicates the owner collection of the level, as an object of Levels type.
oLevel Level Specifies a level to copy data from, as an object of Level type.

Members

Align :exontrol.AlignEnum

The Align property gets or sets the label's alignment within the level. The Label property gets or sets the format to display the level's label. The ToolTip property gets or sets the expression to define the level's tooltip. By default, the label for base level is centered, while for any other level is left-aligned.

The Align property of exontrol.AlignEnum type, supports the following values:

  • exAlignTop (0x00), justifies the object to the top of the rectangle
  • exAlignLeft (0x00), aligns object to the left
  • exAlignCenter (0x01), centers object horizontally in the rectangle
  • exAlignRight (0x02), aligns object to the right
  • exAlignVCenter (0x04), centers object vertically
  • exAlignBottom (0x08), justifies the object to the bottom of the rectangle
Type:
  • exontrol.AlignEnum
Example
null {null}, centers the label for the base level (equivalent of 0x15), and aligns to left for any other (equivalent of 0x14)
4 (0x04) {number}, vertical centers the label, and left aligns the label
24 (0x16) {number}, vertical centers the label, and right aligns the label (inside the chart)
Align

Count :number

The Count property gets or sets the count of unit-scale within the level to display at once. The Count property should be a positive integer. The Unit property gets or sets the level's unit-scale. The unit-scale indicates the time unit that the level displays. By default, the count is 1.
Type:
  • number
Example
2 {number}, specifies that the level displays every second time-unit

The following statements are equivalent:

 oGantt.Chart.Level(0).SetCount(2), sets the count of unit-scale within the level to display at once
 oGantt.Chart.Level(0).Count = 2, sets the count of unit-scale within the level to display at once

where oGantt is an object of exontrol.Gantt type
Count

DrawGridLines :boolean

The DrawGridLines property shows or hides the grid lines for the current level (the grid lines are shown in the items section only). The grid lines are drawn based on the level's time-units. The grid lines are shown in the chart area, while the DrawTickLines property shows or hides the tick lines in the header area. By default, the DrawGridLines property is null, meaning that the grid lines are shown for the second level if two or more levels are defined, otherwise the grid lines are shown for the base level.
Type:
  • boolean
Example
true {boolean}, shows the grid lines for the current level
false {boolean}, hides the grid lines for the current level

The following statements are equivalent:

 oGantt.Chart.Level(0).SetDrawGridLines(true), shows the grid lines for the current level
 oGantt.Chart.Level(0).DrawGridLines = true, shows the grid lines for the current level

where oGantt is an object of exontrol.Gantt type
DrawGridLines

DrawTickLines :Gantt.LevelLineEnum

The DrawTickLines property shows or hides the tick lines for the current level (the tick lines are shown in the header section only). The tick lines are drawn based on the level's time-units. The tick lines are shown in the header area, while the DrawGridLines property shows or hides the grid lines in the chart area. The DrawTickLinesFrom property shows additional tick lines from another level. By default, the DrawTickLines property is exLevelDefaultLine(-1), meaning that the tick lines are shown for the second level if two or more levels are defined, otherwise the tick lines are shown for the base level. The DrawTickLines property of exontrol.Gantt.LevelLineEnum type, supports the following values and flags:
  • exLevelNoLine(0), no line is shown
  • exLevelDefaultLine(-1), indicates the default grid line style
  • exLevelDotLine(1), indicates a dotted line. For vertical/tick lines, it can be combined with exLevelLowerHalf, exLevelUpperHalf or exLevelMiddleLine. Can be combined with exLevelLowerHalf, exLevelUpperHalf or exLevelMiddleLine option.
  • exLevelSolidLine(2), indicates a solid line. For vertical/tick lines, it can be combined with exLevelLowerHalf, exLevelUpperHalf or exLevelMiddleLine. Can be combined with exLevelLowerHalf, exLevelUpperHalf or exLevelMiddleLine option.
  • exLevelLowerHalf(0x10), indicates that the line is shown in the lower half of the level. For vertical/tick lines, it can be combined with exLevelDotLine or exLevelSolidLine
  • exLevelUpperHalf(0x20), indicates that the line is shown in the upper half of the level. For vertical/tick lines, it can be combined with exLevelDotLine or exLevelSolidLine
  • exLevelMiddleLine(0x40), indicates that the line is shown in the middle. For vertical/tick lines, it can be combined with exLevelDotLine or exLevelSolidLine
  • exLevelQuarterHeight(0x100), indicates that the line is shown as a quarter of the full height. Specify the exLevelQuarterHeight option to show shorter tick lines in the chart's level. Can be combined with exLevelLowerHalf, exLevelUpperHalf or exLevelMiddleLine option
Type:
Example
0 or exontrol.Gantt.LevelLineEnum.exLevelNoLine {number}, hides the level's tick lines
 0x22 or exontrol.Gantt.LevelLineEnum.exLevelSolidLine | exontrol.Gantt.LevelLineEnum.exLevelUpperHalf {number}, shows the level's tick lines in the upper-half as solid lines

The following statements are equivalent:

 oGantt.Chart.Level(0).SetDrawTickLines(0x22), sets the type of the level's tick lines
 oGantt.Chart.Level(0).DrawTickLines = 0x22, sets the type of the level's tick lines

where oGantt is an object of exontrol.Gantt type
DrawTickLines

DrawTickLinesFrom :string

The DrawTickLinesFrom property shows additional tick lines from a different level (chart's header only). The tick lines are drawn based on the level's time-units. The tick lines are shown in the header area, while the DrawGridLines property shows or hides the grid lines in the chart area. The DrawTickLines property shows or hides the tick lines for the current level. The DrawTickLinesFrom property indicates two-values separated by comma character as "level,type" format, where:
  • level, {number} specifies the index of the level to show additional tick lines from
  • type, {Gantt.LevelLineEnum} specifies the type of tick lines to display
By default, the DrawTickLinesFrom property is an empty string, meaning that no additional tick lines are shown from another level.
Type:
  • string
Example
"0,2" {string}, displays additional tick-lines from level (0-index) as solid lines(exLevelSolidLine(2))

The following statements are equivalent:

 oGantt.Chart.Level(0).SetDrawTickLinesFrom("0,2"), sets whether the level shows tick lines from another level
 oGantt.Chart.Level(0).DrawTickLinesFrom = "0,2", sets whether the level shows tick lines from another level

where oGantt is an object of exontrol.Gantt type
DrawTickLinesFrom

FormatLabel :string

The FormatLabel property defines the expression or formula that controls how the level's label is displayed. The expression of string type, supports the following keywords:
  • "value" {string}, gets the label of the level as provided with no format
  • "dvalue" {Date}, indicates the date-time value of the unit in the label to format
The expression supports also ex-HTML tags such as (<b>, <i>, <fgcolor>, ...).
Type:
  • string
Example
"weekday(dvalue) = 1 ? (`&lt;bgcolor 000000&gt;&lt;fgcolor FFFFFF&gt; ` + value + ` `) : value", shows every Monday in black and white
 "((weekday(dvalue) in (0,6)) ? `&lt;fgcolor 808080&gt;` : ``) + value" {string}, shows every Saturday and Sunday in gray

The following statements are equivalent:

 oGantt.Chart.Level(0).SetFormatLabel("((weekday(dvalue) in (0,6)) ? `&lt;fgcolor 808080&gt;` : ``) + value"), sets the format to display the level's label
 oGantt.Chart.Level(0).FormatLabel = "((weekday(dvalue) in (0,6)) ? `&lt;fgcolor 808080&gt;` : ``) + value", sets the format to display the level's label

where oGantt is an object of exontrol.Gantt type
FormatLabel

Label :any

The Label property gets or sets the format to display the level's label. The chart's header is organized into multiple levels, each capable of displaying its own time scale. Each level shows date-time values according to the Chart.Labels property. Since Chart.Labels provides a list of alternative captions, the control automatically selects the most appropriate one based on the available width of the time unit. The Align property gets or sets the label's alignment within the level.

The label supports alternative HTML labels being separated by "<|>" and values for Count and Unit being separated by "<||>". By alternate HTML label we mean that you can define a list of HTML labels that may be displayed in the chart's header based on the space allocated for the time-unit. In other words, the control chooses automatically the alternate HTML label to be displayed for best fitting in the portion of the chart where the time-unit should be shown.

The label format is "ALT1[<|>ALT2<|>...[<||>COUNT[<||>UNIT]]]" where

ALT defines a HTML label
COUNT specifies the value for the count field
UNIT field indicates the value for the unit field, representing a numeric value of exontrol.UnitEnum
(the parts delimited by [] brackets may miss)

The ALT part of the label supports ex-HTML tags such as (<b>, <i>, <fgcolor>, ...) and <%DATE%> tags as follows:

Name Description Sample
(day-patterns)
<%d%>Day of the month using one or two numeric digits, depending on the value1 - 31
<%dd%>Day of the month using exactly two numeric digits01 - 31
<%d1%>Weekday using its first letterS - S
<%loc_d1%>Weekday as a single-letter abbreviation based on the current user settingsS - S
<%d2%>Weekday using its first two lettersSu - Sa
<%loc_d2%>Weekday as a two-letter abbreviation based on the current user settingsSu - Sa
<%d3%>Weekday using its first three lettersSun - Sat
<%ddd%>Weekday using its first three lettersSun - Sat
<%loc_d3%>Weekday as a three-letter abbreviation based on the current user regional and language settings; equivalent to <%loc_ddd%>Sun - Sat
<%loc_ddd%>Weekday as a three-letter abbreviation based on the current user regional and language settingsSun - Sat
<%dddd%>Full name of the weekdaySunday - Saturday
<%loc_dddd%>Full weekday name based on the current user regional and language settingsSunday - Saturday
<%w%>Numeric day of the week1 - 7
<%y%>Numeric day of the year1 - 366
(week-patterns)
<%ww%>Week of the year1 - 53
(month-patterns)
<%m%>Month of the year using one or two numeric digits, as needed1 - 12
<%mm%>Month of the year using exactly two numeric digits01 - 12
<%mr%>Month of the year using Roman numerals, as neededI - XII
<%m1%>Month using its first letterJ - D
<%loc_m1%>Month as a single-letter abbreviation based on the current user settingsJ - D
<%m2%>Month using its first two lettersJa - De
<%loc_m2%>Month as a two-letter abbreviation based on the current user settingsJa - De
<%m3%>Month using its first three lettersJan - Dec
<%mmm%>Month using its first three lettersJan - Dec
<%loc_m3%>Month as a three-letter abbreviation based on the current user regional and language settings; equivalent to <%loc_mmm%>Jan - Dec
<%loc_mmm%>Month as a three-letter abbreviation based on the current user regional and language settingsJan - Dec
<%mmmm%>Full name of the monthJanuary - December
<%loc_mmmm%>Full month name based on the current user regional and language settingsJanuary - December
(year-patterns)
<%q%>Date shown as the quarter of the year1 - 4
<%hy%>Date shown as the half of the year1 - 2
<%loc_y%>Year represented by the last digit only, based on the current regional settings0 - 9
<%yy%>Last two digits of the year01 - 99
<%loc_yy%>Year represented by the last two digits only, based on the current regional settings; a leading zero is added for single-digit years01 - 99
<%yyyy%>Full year using four digits0100 - 9999
<%loc_yyyy%>Year represented using four or five digits, depending on the calendar in use. Thai Buddhist and Korean calendars use five-digit years; the "yyyy" pattern displays five digits for these calendars and four digits for all other supported calendars. Calendars with single-digit or two-digit years, such as the Japanese Emperor era, are formatted differently: single-digit years include a leading zero (for example, "03"), two-digit years use two digits (for example, "13"), and no additional leading zeros are applied0100 - 9999
<%i%>Numeric value displayed instead of a date, representing the number of milliseconds elapsed since the Unix Epoch, January 1, 1970, 00:00:00 UTC1767085565940
(localized era-patterns)
<%loc_g%>Period/era based on the current user regional and language settingsA,B
<%loc_gg%>Period/era based on the current user regional and language settingsAD,BC
(localized date-patterns)
<%loc_sdate%>Date in short format based on the current user regional and language settings12/31/2000
<%loc_ldate%>Date in long format based on the current user regional and language settingsDecember 31, 2000
<%loc_dsep%>Date separator based on the current user regional and language settings/
(time-patterns)
<%h%>Hour in one or two digits, as needed0 - 23
<%hh%>Hour in two digits00 - 23
<%h12%>Hour in 12-hour format, in one or two digits0/12 - 11
<%hh12%>Hour in 12-hour format, in two digits00/12 - 11
<%n%>Minute in one or two digits, as needed0 - 59
<%nn%>Minute in two digits00 - 59
<%s%>Second in one or two digits, as needed0 - 59
<%ss%>Second in two digits00 - 59
<%AM/PM%>12-hour clock with uppercase "AM" or "PM" as appropriateAM, PM
(localized time-patterns)
<%loc_AM/PM%>Time marker such as AM or PM based on the current user regional and language settingsAM, PM
<%loc_A/P%>Single-character time marker such as A or P based on the current user regional and language settingsA, P
<%loc_time%>Time based on the current user regional and language settings1:30:15 PM
<%loc_time24%>Time in 24-hour format without a time marker based on the current user regional and language settings13:30:15
<%loc_tsep%>Time separator based on the current user regional and language settings:
Type:
  • any
Example
"" {string}, displays no label
"&lt;|&gt;&lt;%d1%&gt;&lt;|&gt;&lt;%d2%&gt;&lt;|&gt;&lt;%d3%&gt;&lt;|&gt;&lt;%dddd%&gt;&lt;|&gt;&lt;%d3%&gt;, &lt;%m3%&gt; &lt;%d%&gt;, '&lt;%yy%&gt;&lt;|&gt;&lt;%dddd%&gt;, &lt;%mmmm%&gt; &lt;%d%&gt;, &lt;%yyyy%&gt;&lt;||&gt;1&lt;||&gt;4096" {string}, indicates a list of 7 alternate HTML labels, the Count property set on 1 and the Unit property set on exDay (4096)

The following statements are equivalents:

 oGantt.Chart.Level(0).SetLabel("..."), sets the format to display the level's label
 oGantt.Chart.Level(0).Label = "...", sets the format to display the level's label

where oGantt is an object of exontrol.Gantt type
Label

Options :LevelOptions

The Options property applies new options to the chart's level. The Options property calls the associated Set... method for each option specified within the value object. The Options property ignores any option that is not specified within the value object. Use the Options property to change multiple options of the level at once. Each option of the value object is associated with a property of the Level object. For instance, the option:
label {string}, indicates the format to display the level's label
is associated with the property:
Label {string}, indicates the format to display the level's label
Type:
Example
The following statements are equivalents:

 oLevel.SetOptions( {...} ), applies new options to the chart's level
 oLevel.Options = {...}, applies new options to the chart's level  

where oLevel is an object of Level type
Options

Shape :any

The Shape property gets or sets the label's shape. The level'shape defines the background appearance of the level. The "level" field of Shapes property defines the visual-appearance for level's header (the area where the label is displayed). The Shape property can be used to customize the level's header, by applying a custom shape on it.

The Shape property can be set as any of the following:

  • the shape's name within the exontrol.Shapes.Tree or exontrol.Shapes namespace
  • a CSS color
  • a JSON string-representation of an object of exontrol.Def.Shape type, for the column itself
  • an object of {normal,hover,click,disabled} type. The normal, hover, click and disabled are objects of exontrol.Def.Shape type
Type:
  • any
Example
"" {string}, null {null}, no shape is applied
 "red" {string}, fills the object's background in red (CSS color)
 '{"fillColor": "red"}' or '{"normal":{"fillColor": "red"}}' {string}, fills the object's background in red (JSON-representation of an object of exontrol.Def.Shape type)
 "xxx" {string}, indicates that exontrol.Shapes.Gantt.xxx or exontrol.Shapes.xxx is applied on the object's background. If the xxx field is missing, no custom shape is applied (no default object's shape is be applied)
 "Button" or exontrol.Shapes.Button {object}, applies the "Button" shape on the object as defined into exontrol.Shapes namespace (@since 5.2)

The following statements are equivalent:

 oGantt.Chart.Level(0).SetShape("red"), sets the label's shape
 oGantt.Chart.Level(0).Shape = "red", sets the label's shape

where oGantt is an object of exontrol.Gantt type
Shape

ToolTip :string

The ToolTip property gets or sets the expression to define the level's tooltip. The tooltip is shown when the mouse pointer hovers over the level's header area. The Label property gets or sets the format to display the level's label.

The expression supports ex-HTML tags such as (<b>, <i>, <fgcolor>, ...) and <%DATE%> tags as follows:

Name Description Sample
(day-patterns)
<%d%>Day of the month using one or two numeric digits, depending on the value1 - 31
<%dd%>Day of the month using exactly two numeric digits01 - 31
<%d1%>Weekday using its first letterS - S
<%loc_d1%>Weekday as a single-letter abbreviation based on the current user settingsS - S
<%d2%>Weekday using its first two lettersSu - Sa
<%loc_d2%>Weekday as a two-letter abbreviation based on the current user settingsSu - Sa
<%d3%>Weekday using its first three lettersSun - Sat
<%ddd%>Weekday using its first three lettersSun - Sat
<%loc_d3%>Weekday as a three-letter abbreviation based on the current user regional and language settings; equivalent to <%loc_ddd%>Sun - Sat
<%loc_ddd%>Weekday as a three-letter abbreviation based on the current user regional and language settingsSun - Sat
<%dddd%>Full name of the weekdaySunday - Saturday
<%loc_dddd%>Full weekday name based on the current user regional and language settingsSunday - Saturday
<%w%>Numeric day of the week1 - 7
<%y%>Numeric day of the year1 - 366
(week-patterns)
<%ww%>Week of the year1 - 53
(month-patterns)
<%m%>Month of the year using one or two numeric digits, as needed1 - 12
<%mm%>Month of the year using exactly two numeric digits01 - 12
<%mr%>Month of the year using Roman numerals, as neededI - XII
<%m1%>Month using its first letterJ - D
<%loc_m1%>Month as a single-letter abbreviation based on the current user settingsJ - D
<%m2%>Month using its first two lettersJa - De
<%loc_m2%>Month as a two-letter abbreviation based on the current user settingsJa - De
<%m3%>Month using its first three lettersJan - Dec
<%mmm%>Month using its first three lettersJan - Dec
<%loc_m3%>Month as a three-letter abbreviation based on the current user regional and language settings; equivalent to <%loc_mmm%>Jan - Dec
<%loc_mmm%>Month as a three-letter abbreviation based on the current user regional and language settingsJan - Dec
<%mmmm%>Full name of the monthJanuary - December
<%loc_mmmm%>Full month name based on the current user regional and language settingsJanuary - December
(year-patterns)
<%q%>Date shown as the quarter of the year1 - 4
<%hy%>Date shown as the half of the year1 - 2
<%loc_y%>Year represented by the last digit only, based on the current regional settings0 - 9
<%yy%>Last two digits of the year01 - 99
<%loc_yy%>Year represented by the last two digits only, based on the current regional settings; a leading zero is added for single-digit years01 - 99
<%yyyy%>Full year using four digits0100 - 9999
<%loc_yyyy%>Year represented using four or five digits, depending on the calendar in use. Thai Buddhist and Korean calendars use five-digit years; the "yyyy" pattern displays five digits for these calendars and four digits for all other supported calendars. Calendars with single-digit or two-digit years, such as the Japanese Emperor era, are formatted differently: single-digit years include a leading zero (for example, "03"), two-digit years use two digits (for example, "13"), and no additional leading zeros are applied0100 - 9999
<%i%>Numeric value displayed instead of a date, representing the number of milliseconds elapsed since the Unix Epoch, January 1, 1970, 00:00:00 UTC1767085565940
(localized era-patterns)
<%loc_g%>Period/era based on the current user regional and language settingsA,B
<%loc_gg%>Period/era based on the current user regional and language settingsAD,BC
(localized date-patterns)
<%loc_sdate%>Date in short format based on the current user regional and language settings12/31/2000
<%loc_ldate%>Date in long format based on the current user regional and language settingsDecember 31, 2000
<%loc_dsep%>Date separator based on the current user regional and language settings/
(time-patterns)
<%h%>Hour in one or two digits, as needed0 - 23
<%hh%>Hour in two digits00 - 23
<%h12%>Hour in 12-hour format, in one or two digits0/12 - 11
<%hh12%>Hour in 12-hour format, in two digits00/12 - 11
<%n%>Minute in one or two digits, as needed0 - 59
<%nn%>Minute in two digits00 - 59
<%s%>Second in one or two digits, as needed0 - 59
<%ss%>Second in two digits00 - 59
<%AM/PM%>12-hour clock with uppercase "AM" or "PM" as appropriateAM, PM
(localized time-patterns)
<%loc_AM/PM%>Time marker such as AM or PM based on the current user regional and language settingsAM, PM
<%loc_A/P%>Single-character time marker such as A or P based on the current user regional and language settingsA, P
<%loc_time%>Time based on the current user regional and language settings1:30:15 PM
<%loc_time24%>Time in 24-hour format without a time marker based on the current user regional and language settings13:30:15
<%loc_tsep%>Time separator based on the current user regional and language settings:
Type:
  • string
Example
"&lt;%ddd%&gt; &lt;%m%&gt;/&lt;%d%&gt;/&lt;%yyyy%&gt;" displays the level's date such as "Sun 12/2/2007"
 
The following statements are equivalent:

 oGantt.Chart.Level(0).SetToolTip("..."), sets the expression to define the level's tooltip
 oGantt.Chart.Level(0).ToolTip = "...", sets the expression to define the level's tooltip

where oGantt is an object of exontrol.Gantt type
ToolTip

Unit :exontrol.UnitEnum

The Unit property gets or sets the level's unit-scale. The unit-scale indicates the time unit that the level displays. The Count property gets or sets the count of unit-scale within the level to display at once. The Unit and Count properties are interrelated, meaning that changing one of them may affect the other. For example, if you set the Unit property to exHour and the Count property to 24, the level will display days instead of hours.

The Unit property is of exontrol.UnitEnum type, which supports the following values:

  • exYear (0), indicates the year scale
  • exHalfYear (1), indicates the half-year scale
  • exQuarterYear (2), indicates the quarter-year scale
  • exMonth (0x10), indicates the month scale
  • exThirdMonth (0x11), indicates the third-month scale
  • exWeek (0x100), indicates the week scale
  • exDay (0x1000), indicates the day scale
  • exHour (0x10000), indicates the hour scale
  • exMinute (0x100000), indicates the minute scale
  • exSecond (0x1000000), indicates the second scale
Type:
  • exontrol.UnitEnum
Example
4096 or exontrol.UnitEnum.exDay {number}, indicates that the level displays days

The following statements are equivalent:

 oGantt.Chart.Level(0).SetUnit(4096), sets the level's unit-scale
 oGantt.Chart.Level(0).Unit = 4096, sets the level's unit-scale

where oGantt is an object of exontrol.Gantt type
Unit

Methods