Xceed Chart for WinForms v4.4 Documentation
Offset Property (ChartText)
Example 


Xceed.Chart.Standard.v4.4 Assembly > Xceed.Chart.Standard Namespace > ChartText Class : Offset Property
Controls the offset of the text origin point from the text base point.
Syntax
'Declaration
 
<EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="Xceed.Chart.GraphicsCore.PointEditor, Xceed.Chart.GraphicsCore.v4.4, Version=4.4.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6")>
<CategoryAttribute("Position")>
<DescriptionAttribute("Controls the offset of the text origin point from the text base point.")>
Public Property Offset As PointF
'Usage
 
Dim instance As ChartText
Dim value As PointF
 
instance.Offset = value
 
value = instance.Offset
[Editor(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="Xceed.Chart.GraphicsCore.PointEditor, Xceed.Chart.GraphicsCore.v4.4, Version=4.4.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6")]
[Category("Position")]
[Description("Controls the offset of the text origin point from the text base point.")]
public PointF Offset {get; set;}
Remarks
The base point and the origin point deserve special attention. It is essential to understand their meaning because they work together to determine the final text position on the screen. The base point is specified by the control and cannot be changed. For example when you have a bar serie it will position the base points for the texts at the top of each bar. Another example are the axes which positions the base points at the major axis ticks. The origin point is always specified relative to the base point. The value is given in pixels. The default value is 0.
Example
The following example creates a label ten pixels away from the left top corner of the control.
Dim label As ChartLabel =  New ChartLabel() 
label.Text = "Offset of the origin point 10"
label.HorizontalMargin = 0
label.VerticalMargin = 0
label.TextProps.HorzAlign = StringAlignment.Near
label.TextProps.VertAlign = StringAlignment.Near
label.TextProps.Offset = New PointF(10, 10)
ChartControl.Labels.Add(label)
ChartLabel label = new ChartLabel();
label.Text = "Offset of the origin point 10";
label.HorizontalMargin = 0;
label.VerticalMargin = 0;
label.TextProps.HorzAlign = StringAlignment.Near;
label.TextProps.VertAlign = StringAlignment.Near;
label.TextProps.Offset = new PointF(10, 10);
ChartControl.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

ChartText Class
ChartText Members