IVZDataScale.ConstructScaleElements

Fore Syntax

ConstructScaleElements(Values: IVZDataArray);

Fore.NET Syntax

ConstructScaleElements(Values: Prognoz.Platform.Interop.Visualizators.VZDataArray);

Parameters

Values. Array of data displayed by visualizer. The scale is calculated by this data.

Description

The ConstructScaleElements method recalculates visualizer scale by means of the data array and specified calculation mode.

Comment

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.

Fore example

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.

Fore.NET example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Visualizators;

...

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Scale: IVZDataScale; // Color scale
    DataSource: IVZMultiplyDataSource; // Data source
    Values: VZDataArray; // Data array
Begin
    // Get metabase object
    Metabase := Params.Metabase;
    // 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.vsatScaleLogarithmic;
    // 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 
        System.Diagnostics.Debug.WriteLine("No data, scale is not calculated");
    End If;
    // Save changes made in express report 
    (EaxAnalyzer As IMetabaseObject).Save();
End Sub;

See also:

IVZDataScale