DisplayName: String;
The DisplayName property returns distribution name.
To execute the example, the form must have the ChartBox component and the UiChart component which serves as the source for ChartBox.
Class MyForm: Form
ChartBox1: ChartBox;
UiChart1: UiChart;
Uniform: SmUniformDistribution;
Values: Array Of Double;
Const Cnt = 10;
Sub MyFormOnCreate(Sender: Object; Args: IEventArgs);
Begin
Uniform := New SmUniformDistribution.Create;
Text := Uniform.DisplayName; // The panel of form title displays distribution name
Uniform.A := 0.1;
Uniform.B := 0.8;
Values := Uniform.RandomVector(Cnt);
UiChart1.PointCount := cnt;
End Sub MyFormOnCreate;
Sub UiChart1OnGetDataValue(Sender: Object; Args: IUiChartGetDataValueEventArgs);
Begin
If Args.PointIndex < Cnt Then
Args.Value := Values[Args.PointIndex];
Args.Result := True;
End If;
End Sub UiChart1OnGetDataValue;
End Class MyForm;
After executing the example a uniform distribution graph is created for the value:
See also: