EnableReducingLabelSize: Boolean;
EnableReducingLabelSize: boolean;
The EnableReducingLabelSize property determines whether label font on the value axis is automatically reduced.
Available values:
Executing the example requires a form containing the components:
A button with the Button1 identifier.
ChartBox named ChartBox1, the Source property must be set up for the UiChart1 data source.
UiChart named UiChart1 that is a data source for ChartBox1. Set the PointCount and SerieCount properties to random values.
Add links to the MathFin, Forms, Chart system assemblies.
The example is a handler of the OnClick event for the Button1 component. To display data in the chart for the UiChart1 component, add the OnGetDataValue event handler, in which random values for the chart and the fixed step for value axis are set.
Class TestForm: Form
UiChart1: UiChart;
ChartBox1: ChartBox;
Button1: Button;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Chart : IChart;
Axis1 : IChartAxis;
Begin
Chart := UiChart1.Chart;
Axis1 := Chart.AxisY;
// Set automatic reducing of fotn size of labels on the Y value axis
Axis1.EnableReducingLabelSize := True;
End Sub Button1OnClick;
// Fill the chart with random data
Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
Var
Chart : IChart;
Axis1 : IChartAxis;
Begin
// Fill the chart with random data
Args.Result := True;
Args.Value := Math.RandBetween(10,40);
// Set fixed step for the Y value axis
Chart := UiChart1.Chart;
Axis1 := Chart.AxisY;
Axis1.StepMode := ChartAxisStepMode.FixedStep;
Axis1.StepValue := 5;
End Sub UiChart1OnGetDataValue;
End Class TestForm;
After executing the example, on resizing the chart the font size of labels is reduced only on clicking the Button1 button.
The requirements and result of the Fore.NET example execution match with those of the Fore example. Use Fore.NET analogs instead of Fore components.
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.MathFin;
...
Private Sub uiChartNet1_OnGetDataValue(Sender: System.Object; Args: Prognoz.Platform.Interop.Chart.UiChartGetDataValueEventArgs);
Var
Chart : IChart;
Axis1 : IChartAxis;
CMath : MathClass = New MathClass();
Begin
// Fill the chart with random data
Args.Result := True;
Args.Value := CMath.RandBetween(10,40);
// Set fixed step for the Y value axis
Chart := UiChartNet1.ChartUi.Chart;
Axis1 := Chart.AxisY;
Axis1.StepMode := ChartAxisStepMode.casmFixedStep;
Axis1.StepValue := 5;
End Sub;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
Chart : IChart;
Axis1 : IChartAxis;
Begin
Chart := UiChartNet1.ChartUi.Chart;
Axis1 := Chart.AxisY;
// Set automatic reducing of fotn size of labels on the Y value axis
Axis1.EnableReducingLabelSize := True;
End Sub;
See also: