Xceed Chart for WinForms v4.4 Documentation
Labels

Welcome to Xceed Chart for WinForms v4.4 > User Guide > Texts and Labels > Labels

Labels are normal texts that are always displayed over the 3D scene. They usually contain descriptive information about the image generated by the control. Labels are represented by the ChartLabel object. The ChartLabelCollection object of the control contains the labels displayed by the chart.

Label Position

The ChartLabel object allows you to position the label at an arbitrary position in the control window. You specify the position (or origin point) of the label object in as a percentage of the control window's dimensions, using the HorizontalMargin and VerticalMargin properties. The following code creates a new label at the top left corner of the control:

VB.NET  

Dim label As Label =  New Label()

 

label.Text = "Hello world"

label.HorizontalMargin = 0

label.VerticalMargin = 0

label.TextProps.HorzAlign = HorzAlign.Left

label.TextProps.VertAlign = VertAlign.Top

label.TextProps.Font = New Font("Arial", 22)

 

chartControl.Labels.Add(label)

C#  
ChartLabel label = new ChartLabel();
label.Text = "Hello world";
label.HorizontalMargin = 0;
label.VerticalMargin = 0;
label.TextProps.HorzAlign = HorzAlign.Left;
label.TextProps.VertAlign = VertAlign.Top;
label.TextProps.Font = new Font("Arial", 22);
ChartControl.Labels.Add(label);

Label Text

The text displayed by the label is controlled by the Text property of the ChartLabel object. The ChartText object associated with the label allows you to control text properties such as font, color, and orientation, and can be accessed via the TextProps property of the label.

Miscellaneous

All labels have an associated Interactivity object, which allows them to display custom tooltips or react to mouse actions the user performs on them. These features are discussed in detail in the Interactivity book in the Users Guide.

Related Examples

Windows Forms: Labels\General 

Web Forms: Labels\General

See Also

ChartText | Backplane | ChartLabel