Xceed Chart for WinForms v4.4 Documentation
HorizontalMargin Property (ChartLabel)
Example 


Xceed.Chart.Standard.v4.4 Assembly > Xceed.Chart.Standard Namespace > ChartLabel Class : HorizontalMargin Property
The horizontal position (or origin point) of the label object.
Syntax
'Declaration
 
<DescriptionAttribute("The horizontal position (or origin point) of the label object")>
<DefaultValueAttribute()>
<CategoryAttribute("Position")>
Public Property HorizontalMargin As Single
'Usage
 
Dim instance As ChartLabel
Dim value As Single
 
instance.HorizontalMargin = value
 
value = instance.HorizontalMargin
[Description("The horizontal position (or origin point) of the label object")]
[DefaultValue()]
[Category("Position")]
public float HorizontalMargin {get; set;}
Remarks
This property defines the horizontal position of the label in percents of the control window width. For example if you have a chart with widht and height of 100x100 then HorizontalMargin = 10 means that the origin point is 10 pixels from the left side of the control window.
Example
The following example positions the label at the upper left corner of the control.
Dim label As ChartLabel =  New ChartLabel() 
label.Text = "Hello world"
label.HorizontalMargin = 0
label.VerticalMargin = 0
label.TextProps.HorizontalAlign = HorizontalAlign.Left
label.TextProps.VerticalAlign = VerticalAlign.Top
m_Form.nChartControl1.Labels.Add(label)
ChartLabel label = new ChartLabel();
label.Text = "Hello world";
label.HorizontalMargin = 0;
label.VerticalMargin = 0;
label.TextProps.HorizontalAlign = HorizontalAlign.Left;
label.TextProps.VerticalAlign = VerticalAlign.Top;
m_Form.nChartControl1.Labels.Add(label);
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ChartLabel Class
ChartLabel Members