ChartLabelType class (Gantt)

ChartLabelType()

new ChartLabelType()

The ChartLabelType type represents the predefined label formats for chart time-units including year, halfYear, quarterYear, month, thirdMonth, week, day, hour, minute, and second. The chart's header can display one or multiple levels, and each level can show different labels for its time units. The control automatically selects the label that best fits within the width of the level's unit. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property.

The label field (or Label property) 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:

The control automatically chooses the best-fitting label.

Example
The following example shows how to define alternate labels for year, month, week, and day time-units:

{
   year:   "&lt;%yy%&gt;&lt;|&gt;'&lt;%yy%&gt;&lt;|&gt;&lt;%yyyy%&gt;",
   month:  "&lt;|&gt;&lt;%m1%&gt;&lt;|&gt;&lt;%m2%&gt;&lt;|&gt;&lt;%m3%&gt;&lt;|&gt;&lt;%mmmm%&gt;&lt;|&gt;&lt;%m3%&gt; '&lt;%yy%&gt;&lt;|&gt;&lt;%mmmm%&gt; &lt;%yyyy%&gt;",
   week:   "&lt;|&gt;&lt;%ww%&gt;&lt;|&gt;&lt;%m3%&gt; &lt;%d%&gt;, '&lt;%yy%&gt;&lt;r&gt;&lt;%ww%&gt;&lt;|&gt;&lt;%mmmm%&gt; &lt;%d%&gt;, &lt;%yyyy%&gt;&lt;r&gt;&lt;%ww%&gt;&lt;||&gt;&lt;||&gt;256",
   day:    "&lt;|&gt;&lt;%d%&gt;&lt;|&gt;&lt;%d1%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%d2%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%d3%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%dddd%&gt; &lt;%d%&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;&lt;||&gt;4096",
}

Here, "&lt;%yy%&gt;&lt;|&gt;'&lt;%yy%&gt;&lt;|&gt;&lt;%yyyy%&gt;" means the "year" label will display using either two or four digits depending on available space.

Members

(static) day :string

The day field specifies the format when the chart displays days. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the day unit using the most detailed format defined in the label (e.g., full weekday name, month, and day). If the width is more limited, it will automatically switch to a shorter format (e.g., abbreviated weekday and day, or just the day number) based on the alternate labels defined in the day field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%d%&gt;&lt;|&gt;&lt;%d1%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%d2%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%d3%&gt; &lt;%d%&gt;&lt;|&gt;&lt;%dddd%&gt; &lt;%d%&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;&lt;||&gt;4096", the level will display the day unit using different formats depending on the available width. If the width is sufficient, it will show the full weekday name, month, and day (e.g., "Monday, January 1"). If the width is more limited, it will show a shorter format (e.g., "Mon 1" or just "1")
day

(static) halfYear :string

The halfYear field specifies the format when the chart displays half-years. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the half-year unit using the most detailed format defined in the label (e.g., "H1 '24"). If the width is more limited, it will automatically switch to a shorter format (e.g., "HY1" or just "1") based on the alternate labels defined in the halfYear field of ChartLabelType.
Type:
  • string
Example
"&lt;%hy%&gt;&lt;|&gt;&lt;%hy%&gt; '&lt;%yy%&gt;&lt;|&gt;&lt;%yyyy%&gt;", the level will display the half-year unit using different formats depending on the available width. If the width is sufficient, it will show the half-year and year (e.g., "H1 '24"). If the width is more limited, it will show a shorter format (e.g., "HY1" or just "1")
halfYear

(static) hour :string

The hour field specifies the format when the chart displays hours. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the hour unit using the most detailed format defined in the label (e.g., "1:00 PM"). If the width is more limited, it will automatically switch to a shorter format (e.g., "1 PM" or just "13") based on the alternate labels defined in the hour field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%h%&gt;&lt;|&gt;&lt;%h12%&gt; &lt;%loc_AM/PM%&gt;&lt;|&gt;&lt;%h12%&gt; &lt;%AM/PM%&gt;&lt;|&gt;&lt;%h%&gt;&lt;|&gt;&lt;%h12%&gt;&lt;|&gt;&lt;%h12%&gt; &lt;%loc_AM/PM%&gt;&lt;|&gt;&lt;%h12%&gt; &lt;%AM/PM%&gt;", the level will display the hour unit using different formats depending on the available width. If the width is sufficient, it will show a detailed format (e.g., "1:00 PM"). If the width is more limited, it will show a shorter format (e.g., "1 PM" or just "13")
hour

(static) minute :string

The minute field specifies the format when the chart displays minutes. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the minute unit using the most detailed format defined in the label (e.g., "1:30"). If the width is more limited, it will automatically switch to a shorter format (e.g., "1:3" or just "30") based on the alternate labels defined in the minute field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%n%&gt;&lt;|&gt;&lt;%nn%&gt;&lt;|&gt;&lt;%n%&gt;", the level will display the minute unit using different formats depending on the available width. If the width is sufficient, it will show a detailed format (e.g., "1:30"). If the width is more limited, it will show a shorter format (e.g., "1:3" or just "30")
minute

(static) month :string

The month field specifies the format when the chart displays months. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the month unit using the most detailed format defined in the label (e.g., full month name). If the width is more limited, it will automatically switch to a shorter format (e.g., abbreviated month or just month number) based on the alternate labels defined in the month field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%m1%&gt;&lt;|&gt;&lt;%m2%&gt;&lt;|&gt;&lt;%m3%&gt;&lt;|&gt;&lt;%mmmm%&gt;&lt;|&gt;&lt;%m3%&gt; '&lt;%yy%&gt;&lt;|&gt;&lt;%mmmm%&gt; &lt;%yyyy%&gt;", the level will display the month unit using different formats depending on the available width. If the width is sufficient, it will show the full month name (e.g., "January"). If the width is more limited, it will show a shorter format (e.g., "Jan" or just "1")
month

(static) quarterYear :string

The quarterYear field specifies the format when the chart displays quarters of the year. A quarter is a division of the year into four parts, each consisting of three months. The first quarter includes January, February, and March; the second quarter includes April, May, and June; the third quarter includes July, August, and September; and the fourth quarter includes October, November, and December.
Type:
  • string
Example
"&lt;%q%&gt;&lt;|&gt;&lt;%hy%&gt;&lt;|&gt;&lt;%m3%&gt; '&lt;%yy%&gt;&lt;|&gt;&lt;%m3%&gt; '&lt;%yyyy%&gt;", the level will display the quarter-year unit using different formats depending on the available width. If the width is sufficient, it will show the month and year (e.g., "Jan '24"). If the width is more limited, it will show a shorter format (e.g., "Q1 '24" or just "Q1")
quarterYear

(static) second :string

The second field specifies the format when the chart displays seconds. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the second unit using the most detailed format defined in the label (e.g., "1:30:45"). If the width is more limited, it will automatically switch to a shorter format (e.g., "1:30:4" or just "45") based on the alternate labels defined in the second field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%s%&gt;&lt;|&gt;&lt;%ss%&gt;&lt;|&gt;&lt;%s%&gt;", the level will display the second unit using different formats depending on the available width. If the width is sufficient, it will show a detailed format (e.g., "1:30:45"). If the width is more limited, it will show a shorter format (e.g., "1:30:4" or just "45")
second

(static) thirdMonth :string

The thirdMonth field specifies the format when the chart displays third-month periods. A third-month period is a division of the year into four parts, each consisting of three months. The first third includes January, February, and March; the second third includes April, May, and June; the third third includes July, August, and September; and the fourth third includes October, November, and December.
Type:
  • string
Example
"&lt;|&gt;&lt;%m3%&gt;&lt;|&gt;&lt;%mmmm%&gt;&lt;|&gt;&lt;%m3%&gt; '&lt;%yy%&gt;", the level will display the third-month unit using different formats depending on the available width. If the width is sufficient, it will show the full month name (e.g., "Jan - Mar"). If the width is more limited, it will show a shorter format (e.g., "M1" or just "1")
thirdMonth

(static) week :string

The week field specifies the format when the chart displays weeks. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the week unit using the most detailed format defined in the label (e.g., "Week 1, Jan 1 - Jan 7"). If the width is more limited, it will automatically switch to a shorter format (e.g., "W1" or just "1") based on the alternate labels defined in the week field of ChartLabelType.
Type:
  • string
Example
"&lt;|&gt;&lt;%ww%&gt;&lt;|&gt;&lt;%m3%&gt; &lt;%d%&gt;, '&lt;%yy%&gt;&lt;r&gt;&lt;%ww%&gt;&lt;|&gt;&lt;%mmmm%&gt; &lt;%d%&gt;, &lt;%yyyy%&gt;&lt;r&gt;&lt;%ww%&gt;&lt;||&gt;&lt;||&gt;256", the level will display the week unit using different formats depending on the available width. If the width is sufficient, it will show a detailed format (e.g., "Week 1, Jan 1 - Jan 7"). If the width is more limited, it will show a shorter format (e.g., "W1" or just "1")
week

(static) year :string

The year field specifies the format when the chart displays years. The UnitWidth property gets ot sets the width to display the units in base-level. The base-level is the level that displays the base unit, as specified by the UnitScale property. The UnitWidthNonworking property gets or sets the width to display the non-working units in base-level. If the width of the level is sufficient, the control will display the year unit using the most detailed format defined in the label (e.g., "2024"). If the width is more limited, it will automatically switch to a shorter format (e.g., "'24" or just "24") based on the alternate labels defined in the year field of ChartLabelType.
Type:
  • string
Example
"&lt;%yy%&gt;&lt;|&gt;'&lt;%yy%&gt;&lt;|&gt;&lt;%yyyy%&gt;", the level will display the year unit using different formats depending on the available width. If the width is sufficient, it will show the full year (e.g., "2024"). If the width is more limited, it will show a shorter format (e.g., "'24" or just "24")
year