TiPlotAxis.PositionToPercent
TiPlotAxis See Also
Used to convert a position value on the axis scale to an axis percent value.
function PositionToPercent(Value : Double) : Double;
Description
Call the PositionToPercent method to convert a position value on the axis
scale to an axis percent value.
The percent is a value between 0 and 1 representing the percent position on a
scale. For example, a value of 0.5 would mean 50% of the scale, or a position
on the scale midway between the min and max values visible on the scale. This
function is useful for converting a scale value to a position percent to be
used when setting the Pointer1Position and Pointer2Position properties of a Data Cursor.
For example, to set the position of the data cursor to a value of 157.25 on
the X-Axis scale, you would set the Pointer1Position property as follows.
iPlot1.DataCursor[0].Pointer1Position :=
iPlot1.XAxis[0].PositionToPercent(157.25) * 100
Note: you can only set the position of a data cursor to a position on the scale
that is currently visible. In other words, if the position is not currently
visible on the X-Axis scale (i.e. off scale), then this will fail.
Example
Delphi
Value := iComponent.XAxis[0].PositionToPercent(157.25);
Value := iComponent.YAxis[0].PositionToPercent(157.25);
C++ Builder
Value = iComponent->XAxis[0]->PositionToPercent(157.25);
Value = iComponent->YAxis[0]->PositionToPercent(157.25);
Contents | Index | Previous | Next