Dundas Chart for ASP.NET
ValueToPosition Method
See Also  Send comments on this topic.
Dundas.Charting.WebControl Namespace > AxisScale Class : ValueToPosition Method


axisValue
An axis value.
Axis value.

Converts an axis value to a relative coordinate.  This method only works in paint events.


This function converts an axis value to relative position (0-100%). If an axis has logarithmic scale, value is converted to a linear scale.

Syntax

Visual Basic (Declaration)  
Public Function ValueToPosition( _
   ByVal axisValue As Double _
) As Double
Visual Basic (Usage) Copy Code
Dim instance As AxisScale
Dim axisValue As Double
Dim value As Double
 
value = instance.ValueToPosition(axisValue)
C#  
public double ValueToPosition( 
   double axisValue
)

Parameters

axisValue
An axis value.
Axis value.

Return Value

The axis coordinate that corresponds to the specified axis value. This returned value is relative to the entire chart image.
Relative position (0-100%).

Remarks

This method returns a relative axis position from a given axis value.  Note that the relative chart coordinate system has the top-left corner of the image at position (0,0) and the bottom-right corner of the chart picture at position (100,100).  For more information concerning the chart's coordinate system see the Chart Coordinate System topic.

If the axis scale is logarithmic then the value is converted so that it uses a linear scale.

If you need to determine a position for a given point in a 2D chart then this method must be called twice, once for each axis value that defines the point (e.g. X axis value of 5, Y axis value of 2.7).

The position returned by this method is relative to the entire chart picture, and not to the ChartArea that the axis belongs to.

This method is useful for performing custom drawing for 3D charts. Custom drawing for 3D charts is performed by transforming Point3D objects, which use relative chart coordinates.  For further information see the Working with 3D Charts  topic.

GDI+ drawing methods use absolute pixel coordinates, so if custom drawing is being done for a 2D chart use the ValueToPixelPosition method instead.

This method only works in paint events.

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

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.