PositionOffset: ChartAxisPositionOffsetType;
PositionOffset: Prognoz.Platform.Interop.Chart.ChartAxisPositionOffsetType;
The PositionOffset property determines the type of axis offset relative to plot area of the chart.
By default axis offset is disabled.
If the offset is used, its value is defined in the IChartAxis.PositionOffsetValue property.
On specified positive value the axis is offset opposite from the plot area. On the negative value it is offset inside the plot area.
This example includes an event handler. To execute an example, add references to the MathFin and Chart system assemblies. Add to the form UiChart with UiChart1 identifier, Button and ChartBox with UiChart1 source to display results of the example.
Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
Begin
Args.Result := True;
Args.Value := Math.RandBetween(10,40);
End Sub UiChart1OnGetDataValue;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var Axis: IChartAxis;
Begin
Axis := UiChart1.Chart.AxisX;
Axis.PositionOffset := ChartAxisPositionOffsetType.Custom;
Axis.PositionOffsetValue := 10;
End Sub Button1OnClick;
After executing the example X axis is offset 10mm left relative to the chart plot area.
This example includes an event handler. To execute an example, add references to the MathFin and Chart system assemblies. Add to the form uiChartNet with uiChartNet1 identifier, button and ChartBoxNet components.
Imports Prognoz.Platform.Interop.MathFin;
Imports Prognoz.Platform.Interop.Chart;
...
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.RandBetween(10,60);
End Sub;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var Axis: IChartAxis;
Begin
Axis := uiChartNet1.ChartUi.Chart.AxisX;
Axis.PositionOffset := ChartAxisPositionOffsetType.capoCustom;
Axis.PositionOffsetValue := 10;
End Sub;
After executing the example X axis is offset 10mm left relative to the chart plot area.
See also: