PositionValue: Double;
The PositionValue property determines an absolute distance to intersection with the orthogonal axis.
To set the distance, set the IChartAxis.Position property to ChartAxisPosition.Custom.
To execute the example, create a form and place the ChartBox, UiChart, Button and FloatEdit components with the default identifiers on the form. The UiChart1 component is a source for the ChartBox1 component. Specify a link to the MathFin system assembly in the inspector of assemblies.
The UiChart1OnGetDataValue procedure is a handler of the OnGetDataValue event for the UiChart1 component.
The MyFormOnShow procedure is a handler of the OnShow event for the form.
The Button1OnClick procedure is a handler of the OnClick event for the button.
Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
Begin
Args.Result := True;
Args.Value := Math.Rand;
End Sub UiChart1OnGetDataValue;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Chart: IChart;
X : IChartAxis;
Begin
Chart := ChartBox1.Chart;
X := Chart.AxisX;
X.Position := ChartAxisPosition.Custom;
X.PositionValue := FloatEdit1.Value;
End Sub Button1OnClick;
Sub MyFormOnShow(Sender: Object; Args: IEventArgs);
Begin
UiChart1.PointCount := 3;
UiChart1.SerieCount := 4;
End Sub OBJ37234FormOnShow;
Set the distance till intersecting with the orthogonal axis and click the button. Position of the X axis will be changed.
See also: