Dundas Chart for Windows Forms
GetPositionFromAxis Method
See Also  Send comments on this topic.
DundasWinChart Assembly > Dundas.Charting.WinControl Namespace > ChartGraphics Class : GetPositionFromAxis Method


chartAreaName
The name of the ChartArea object that owns the specified axis.
Chart Area Name
axis
An AxisName enum value that identifies the relevant axis.
Axis Name Enumeration
axisValue
The axis value that needs to be converted to a relative pixel value.
Value, which has to be converted to relative pixel position

This method takes a given axis value for a specified axis and returns the relative pixel value


This method will return relative pixel position (in percentages 0 – 100) from double value. This method uses axis position and axis scale to find position for the value. This method is very important for custom drawing inside chart area and it helps to find position for a data point value.

Syntax

Visual Basic (Declaration)  
Public Function GetPositionFromAxis( _
   ByVal chartAreaName As String, _
   ByVal axis As AxisName, _
   ByVal axisValue As Double _
) As Double
Visual Basic (Usage) Copy Code
Dim instance As ChartGraphics
Dim chartAreaName As String
Dim axis As AxisName
Dim axisValue As Double
Dim value As Double
 
value = instance.GetPositionFromAxis(chartAreaName, axis, axisValue)
C#  
public double GetPositionFromAxis( 
   string chartAreaName,
   AxisName axis,
   double axisValue
)

Parameters

chartAreaName
The name of the ChartArea object that owns the specified axis.
Chart Area Name
axis
An AxisName enum value that identifies the relevant axis.
Axis Name Enumeration
axisValue
The axis value that needs to be converted to a relative pixel value.
Value, which has to be converted to relative pixel position

Return Value

The converted axis value, in relative pixel coordinates.


Relative pixel position from axis

Remarks

This method takes a given axis value for a specified axis (that belongs to a specified ChartArea object) and returns the relative pixel value.

Note that this method only returns one value per axis type, so to determine the location of a point within the chart image this method needs to be called twice, once per relevant Axis object.

You can convert the relative value this returns to an absolute pixel value using the GetAbsolutePoint Method.

See the Chart Coordinate System topic for a detailed explanation concerning the Chart's coordinate system.

For an example of this method see the Custom Drawing Using the PostPaint Event topic.

Requirements

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

See Also

© 2009 All Rights Reserved.