PositionValue: Double;
PositionValue: System.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.
To execute the example, create a form and place the ChartBoxNet, uiChartNet, Button and numericUpDown components with the default identifiers on the form. The uiChartNet1 is a source for the ChartBoxNet1 component. Add links to the MathFin and Chart system assemblies.
The uiChartNet1_OnGetDataValue procedure is a handler of the OnGetDataValue event for the uiChartNet1 component.
The OBJ37235Form_Shown procedure is a handler of the Shown event for the form.
The button1_Click procedure is a handler of the Click event for the button.
...
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.MathFin;
Public Partial Class OBJ37235Form : Prognoz.Platform.Forms.Net.ForeNetForm
Public Constructor OBJ37235Form();
Begin
InitializeComponent();
End Constructor;
Private Sub uiChartNet1_OnGetDataValue( Sender : System.Object; Args : Prognoz.Platform.Interop.Chart.UiChartGetDataValueEventArgs );
Var
Math: Prognoz.Platform.Interop.MathFin.Math= New MathClass();
Begin
Args.Result := True;
Args.Value := Math.RandBetweenI(10,20);
End Sub;
Private Sub button1_Click( sender : System.Object; e : System.EventArgs );
Var
Chart: IChart;
X : IChartAxis;
Begin
Chart := chartBoxNet1.CtrlBox.Chart;
X := Chart.AxisX;
X.Position := ChartAxisPosition.capCustom;
X.PositionValue := numericUpDown1.Value As Double;
End Sub;
Private Sub OBJ37235Form_Shown( sender : System.Object; e : System.EventArgs );
Begin
uiChartNet1.PointCount := 5;
uiChartNet1.SerieCount := 4;
End Sub;
Set the distance till intersecting with the orthogonal axis and click the button. Position of the X axis will be changed.
See also: