Type | Description | |||
Variant | A String expression that indicates the format of the level's label, an UnitEnum expression that indicates the predefined format being used. The Label property defines predefined formats for labales. |
The Label property 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 property format is "ALT1[<|>ALT2<|>...[<||>COUNT[<||>UNIT]]]" where
The Label property may change the Unit and the Count property. You can always use a different Unit or Count by setting the property after setting the Label property.
The following screen shots shows the chart's header using different values for UnitWidth property.
For instance, Label = "<|><%d1%><|><%d2%><|><%d3%><|><%dddd%><|><%d3%>, <%m3%> <%d%>, '<%yy%><|><%dddd%>, <%mmmm%> <%d%>, <%yyyy%><||>1<||>4096" indicates a list of 7 alternate HTML labels, the Count property set on 1 and the Unit property set on exDay (4096).
So, the header of the level in the chart shows one of the following alternate HTML labels:
based on the space being allocated for the time unit. If the label is being shown on the base level, the UnitWidth property defines the space for the time-unit, so the control chooses the alternate HTML label which best fits the allocated space ( width ). The Font property defines the font to show the chart's labels which is also used to get the best fit label to be displayed. For any other level, the space is automatically calculated based on the base level's width. In other words, when UnitWidth property is changed or the user rescale or zoom the chart area, the chart's header displays alternate labels. If the Label property defines no alternate labels, the single representation is shown no matter of the UnitWidth, Font and other zooming settings.
The Label property may change the Unit property as in the following scenario. Let's say that you need to display the weeks so you choose to have the week number "<%ww%>" or the first day in the week in format "<%d3%>, <%m3%> <%d%>, '<%yy%>" so the Label property should be "<%ww%><|><%d3%>, <%m3%> <%d%>, '<%yy%>". If you are using this format, the Unit property will always be set on exDay, as in the second alternate label the unit is day as the minimum scale unit being found is <%d3%> or <%d%> which indicates days. In order to correct this, you should specify the Unit to be used for the alternate labels as "<%ww%><|><%d3%>, <%m3%> <%d%>, '<%yy%><||><||>256".
For instance, if a level should display 15 to 15 minutes, you can do one of the following:
Any of these statements can be used to let the level displays minutes from 15 to 15.
The Label property supports the following built-in tags:
The following tags are displayed based on the user's Regional and Language Options:
The Label property supports the following built-in HTML tags:
The control supports expandable HTML captions feature which allows you to expand(show)/collapse(hide) different information using <a ;exp=> or <a ;e64=> anchor tags. The exp/e64 field of the anchor stores the HTML line/lines to show once the user clicks/collapses/expands the caption.
Any ex-HTML caption can be transformed to an expandable-caption, by inserting the anchor ex-HTML tag. For instance, <solidline><b>Header</b></solidline><br>Line1<r><a ;exp=show lines>+</a><br>Line2<br>Line3 shows the Header in underlined and bold on the first line and Line1, Line2, Line3 on the rest. The show lines is shown instead of Line1, Line2, Line3 once the user clicks the + sign.
or <font ;31><sha 404040;5;0><fgcolor=FFFFFF>outline anti-aliasing</fgcolor></sha></font> gets:
The Label property may be a combination of any of these tags. For instance, the "<b><%mmm%></b> <%d%>, '<%yy%>" displays a date like: "May 29,'05".
The first level displays the month, the year and the number of the week in the year , the second level displays the name of the week day, and the third level displays the day of the month. The LevelCount property specifies the number of levels being displayed, in our case 3.
The following Template shows how to display your header using three levels as arranged in the picture above ( just copy and paste the following script to Template page ):
BeginUpdate() Chart { LevelCount = 3 Level(0) { Label = "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>" Unit = 256 'exWeek } Level(1).Label = "<%d1%>" Level(2).Label = "<%d%>" } EndUpdate()
The following VB sample displays your header using 3 levels as shown above:
With G2antt1 .BeginUpdate With .Chart .LevelCount = 3 With .Level(0) .Label = "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>" .Unit = EXG2ANTTLibCtl.UnitEnum.exWeek End With .Level(1).Label = "<%d1%>" .Level(2).Label = "<%d%>" End With .EndUpdate End With
The following VFP sample displays your header using 3 levels:
with thisform.g2antt1 .BeginUpdate() with .Chart .LevelCount = 3 with .Level(0) .Label = "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>" .Unit = 256 endwith .Level(1).Label = "<%d1%>" .Level(2).Label = "<%d%>" endwith .EndUpdate() endwith
The following VB.NET sample displays your header using 3 levels:
With AxG2antt1 .BeginUpdate() With .Chart .LevelCount = 3 With .Level(0) .Label = "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>" .Unit = EXG2ANTTLib.UnitEnum.exWeek End With .Level(1).Label = "<%d1%>" .Level(2).Label = "<%d%>" End With .EndUpdate() End With
The following C# sample displays your header using 3 levels:
axG2antt1.BeginUpdate(); EXG2ANTTLib.Chart chart = axG2antt1.Chart; chart.LevelCount = 3; chart.get_Level(0).Label = "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>"; chart.get_Level(0).Unit = EXG2ANTTLib.UnitEnum.exWeek; chart.get_Level(1).Label = "<%d1%>"; chart.get_Level(2).Label = "<%d%>"; axG2antt1.EndUpdate();
The following C++ sample displays your header using 3 levels:
m_g2antt.BeginUpdate(); CChart chart = m_g2antt.GetChart(); chart.SetLevelCount( 3 ); chart.GetLevel(0).SetLabel(COleVariant( "<b><%mmm%>, <%yyyy%></b> <r>Week: <%ww%>" )); chart.GetLevel(0).SetUnit(256); chart.GetLevel(1).SetLabel(COleVariant( "<%d1%>" )); chart.GetLevel(2).SetLabel(COleVariant( "<%d%>" )); m_g2antt.EndUpdate();