Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Standard.v4.4 Assembly / Xceed.Chart.Standard Namespace / ChartLabel Class / VerticalMargin Property
Example


In This Topic
    VerticalMargin Property (ChartLabel)
    In This Topic
    The vertical position (or origin point) of the label object.
    Syntax
    'Declaration
     
    <CategoryAttribute("Position")>
    <DescriptionAttribute("The vertical position (or origin point) of the label object")>
    <DefaultValueAttribute(50)>
    Public Property VerticalMargin As Single
    'Usage
     
    Dim instance As ChartLabel
    Dim value As Single
     
    instance.VerticalMargin = value
     
    value = instance.VerticalMargin
    [Category("Position")]
    [Description("The vertical position (or origin point) of the label object")]
    [DefaultValue(50)]
    public float VerticalMargin {get; set;}
    Remarks
    This property defines the vertical position of the label in percents of the control window height. For example if you have a chart with widht and height of 100x100 then VerticalMargin = 10 means that the origin point is 10 pixels from the top 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