ConstructScaleElements(Values: IVZDataArray);
Values. Array of data displayed by visualizer. The scale is calculated by this data.
The ConstructScaleElements method recalculates visualizer scale by means of the data array and specified calculation mode.
The method is relevant to use if automatic scale step calculation (AutoCalculable=True) is enabled.
Before calculating the scale the number of intervals can be determined.
Executing the example requires that the repository contains express report with the EXPRESS identifier. The Color metric should be selected in the bubble tree report. The module containing the example should have links to the Express, Metabase and Visualizators system assemblies.
Sub UserProc;
Var
Metabase: IMetabase; // Metabase
EaxAnalyzer: IEaxAnalyzer; // Express report
BubbleTree: IVZBubbleTree; // Bubble tree
Scale: IVZDataScale; // Color scale
DataSource: IVZMultiplyDataSource; // Data source
Values: IVZDataArray; // Data array
Begin
// Get metabase object
Metabase := MetabaseClass.Active;
// Get express report object
EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
// Get bubble tree color scale
Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
// Enable automatic scale calculation
Scale.AutoCalculable := True;
// Enable use of the Equals elements in scale
Scale.EnableEquality := True;
// Determine visualizer scale calculation mode
Scale.Mode := VisualizatorScaleMode.ScaleLogarithmic;
// Determine logarithmic scale base
Scale.LogarithmBase := 4;
// Get data source
DataSource := BubbleTree.ColorVisual.ColorMapping.DataSource;
// Get array of data, based on which scale is calculated
Values := New VZDataArray.Create;
Values := DataSource.GetAllLevelDataEx("color",-1);
// Recalculate scale if data was obtained
If Values <> Null Then
Scale.ConstructScaleElements(Values);
Else
Debug.WriteLine("No data, scale is not calculated");
End If;
// Save changes made in express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the visualizer scale is recalculated with specified parameters and data.
See also: