property Level.Label as Variant
Retrieves or sets a value that indicates the format of the level's label.

 TypeDescription 
   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 specifies the label being displayed in the level. Use the Alignment property to specify the label's alignment. Use the ToolTip property to specify the tooltip being displayed when the cursor hovers the level. Use the BackColor and ForeColor properties to change the level's appearance.  The Label property changes the Unit property, so Unit property must be called after changing the Label property, if case. For instance, let's say that we have the Label property as : "<b><%mmm%></b> <%d%>, '<%yy%>", the Unit property will be automatically set to exDay, because the <%d%> is the minimum unit in the format. The WeekDays property retrieves or sets a value that indicates the list of names for each week day, separated by space. Use the MonthNames property to specify the name of the months in the year. The FormatDate property formats a date. Use the ReplaceLabel property to customize the labels as adding icons/images/pictures or change the captions being displayed by default in the chart's header .

The Label property supports the following built-in tags:

The Label property supports the following built-in HTML tags:

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();

 


Send comments on this topic.
© 1999-2008 Exontrol Inc, Software. All rights reserved.