Value(Index: Integer): Double;
Index. Index of returned value.
The Value method returns scale value by its index.
To get the number of scale values, use the IPPSpeedometerScale.ValuesCount property.
Executing the example requires that the repository contains a database with the ADHOC identifier. A dashboard must contain a speedometer.
Add links to the Adhoc, Express, Metabase, Speedometer system assemblies.
Sub UserProc;
Var
Speedometer: IPPSpeedometer;
MB: IMetabase;
AdhocReport: IAdhocReport;
EaxSpeedometer: IEaxSpeedometer;
Enalyzer: IEaxAnalyzer;
DsObjs: IAdhocDataSourceObjects;
Scales: IPPSpeedometerScales;
Scale: IPPSpeedometerScale;
i: Integer;
Begin
MB := MetabaseClass.Active;
// Get dashboard
AdhocReport := MB.ItemById("ADHOC").Edit As IAdhocReport;
// Get dashboard data sources
DsObjs := AdhocReport.DataSourceObjects;
// Get speedometer
Enalyzer := DsObjs.Item(0).GetSourceObject As IEaxAnalyzer;
EaxSpeedometer := Enalyzer.Speedometer;
// Get speedometer parameters
Speedometer := EaxSpeedometer.Speedometer;
// Get collection of speedometer scales
Scales := Speedometer.Scales;
// Get data scale
Scale := Scales.DataScale;
// Display data scale values
For i := 0 To Scale.ValuesCount - 1 Do
Debug.WriteLine(Scale.Value(i));
End For;
// Remove all values
Scale.ClearValues;
// Add a new value
Scale.AddValue(1000);
// Recalculate speedometer scale
Scale.Recalc;
(Enalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the console window displays all data scale values. Old values are removed, a new value is added and speedometer data scale values are recalculated.
See also: