ElementPosition class is base class for many chart visual elements like Legend, Title and ChartArea. It provides the position of the chart element in relative coordinate (0,0 – 100,100).
Visual Basic (Declaration) | |
---|---|
Public Class ElementPosition |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public class ElementPosition |
This class is used to define the position of a chart element, and represents one rectangle via the X, Y, Width and Height properties.
The ElementPosition class is always exposed as a Position object property (e.g. ChartArea.Position, Legend.Position, etc.). It is also exposed in the Paint and BackPaint events as a property of the ChartPaintEventArgs object.
The position of the applicable chart elements can be set automatically by setting the Auto property to TRUE, and chart elements can also be positioned at design-time via the Design View.
Two major differences between this class and a RectangleF structure are:
-
This class can use automatic positioning.
-
This class ONLY uses coordinates ranging from 0 to 100, otherwise an exception is thrown.
The position of chart elements is described using relative coordinates, with the top-left corner of an element having coordinates of "0,0" and the bottom-right corner of an element having coordinates of "100,100". Elements that are plotted within a chart area use coordinates that are relative to the chart area, while elements outside of a chart area use coordinates that are relative to the chart picture.
System.Object
Dundas.Charting.WinControl.ElementPosition
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family