Glossary Item Box

.netCHARTING v3.1 Documentation Send comments on this topic.

Smart Element Labels

Introduction

Each element contains a smart label with options that affect its behavior. To show the element labels the following code can be used to set all elements automatically:

[C#]

Chart.DefaultElement.ShowValue = true;

[Visual Basic]

Chart.DefaultElement.ShowValue = True

Dynamic Labels

DynamicDisplay
Labels that cannot fit on the chart will not be shown by default. To force them to appear, the DynamicDisplay property can be set to false.

[C#]

Chart.DefaultElement.DynamicDisplay = false;

[Visual Basic]

Chart.DefaultElement.DynamicDisplay = False


DynamicPosition
Non-column series type elements have labels which will also move out of each others way so they don't overlap. A line is then drawn to indicate which element the label pertains to. The following code can be used to disable this feature:

[C#]

Chart.DefaultElement.DynamicPosition = false;

[Visual Basic]

Chart.DefaultElement.DynamicPosition = False

The line drawn to indicate the element can be modified through the SmartLabel.Line property.

Line caps can be used to make the lines look like arrow pointers.

 

Column Labeling

Columns series type elements have several other labeling options available.

Alignment
A column label has a default column alignment manipulated with:

[C#]

Chart.DefaultElement.Alignment = LabelAlignment.Top;

[Visual Basic]

Chart.DefaultElement.Alignment = LabelAlignment.Top

Secondary Alignment
There may not always be enough room to place the label in desired position (Alignment). If that is the case, the chart engine will look at the SecondaryAlignment collection of alignments and find the next best one that fits. These can be modified using the following method:

[C#]

Chart.DefaultElement.SecondaryAlignment.Clear();
Chart.DefaultElement.SecondaryAlignment.Add(LabelAlignment.OutsideTop);
Chart.DefaultElement.SecondaryAlignment.Add(LabelAlignment.Bottom);

[Visual Basic]

Chart.DefaultElement.SecondaryAlignment.Clear()
Chart.DefaultElement.SecondaryAlignment.Add(LabelAlignment.OutsideTop)
Chart.DefaultElement.SecondaryAlignment.Add(LabelAlignment.Bottom)

Vertical Label
When a label doesn't fit into a column horizontally it will try to fit vertically. If that doesn't work either, the label font will decrease in size to fit. For cases where columns have both horizontal and vertical labels, columns may be difficult to read. If this is the case, all labels can be forced to show vertically by using this code:

[C#]

Chart.DefaultElement.ForceVertical = true;

[Visual Basic]

Chart.DefaultElement.ForceVertical = True

Note: This feature doesn't affect horizontal charts.


2002 - 2005 Webavail Productions Inc. & Corporate Web Solutions Ltd.. All Rights Reserved.