A: Double;
The A property determines expected value of random value distribution.
Value of expected value should be greater than zero.
To execute the example, the form must have the ChartBox component and the UiChart component which serves as the source for ChartBox.
Class OBJ18690Form: Form
ChartBox1: ChartBox;
UiChart1: UiChart;
Exp: SmExponentialDistribution;
Values: Array Of Double;
Const Cnt = 100;
Sub OBJ18690FormOnCreate(Sender: Object; Args: IEventArgs);
Begin
Exp := New SmExponentialDistribution.Create;
Text := Exp.DisplayName;
Exp.A := 100;
Values := Exp.RandomVector(Cnt);
UiChart1.PointCount := cnt;
End Sub OBJ18690FormOnCreate;
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;
After executing the example a exponential distribution graph is built:
See also: