IVZDataScale.AutoSetupScaleItems

Syntax

AutoSetupScaleItems;

Description

The AutoSetupScaleItems method recalculates visualizer scale based on values of the first and last scale elements.

Comments

The scale is calculated according to scale type:

Before calculating the scale, it is available to set the number of scale intervals.

Example

Executing the example requires that the repository contains express report with the EXPRESS identifier. Add links to the system assemblies: Drawing, Express, Metabase, Visualizators. 

Before executing the example, the color scale of bubble tree looks as shown on the IVZDataScale interface description page. Set the number of intervals equal to 4, determine brushes for the first and last scale elements, and then recalculate the scale:

Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Scale: IVZDataScale; // Color scale
    Color: IGxColor; // Color 
    Brush: IGxSolidBrush;// Brush for scale elements
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // |Get bubble tree scale
    Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
    // Set number of scale intervals
    Scale.IntervalsCount := 4
    // Create amethyst color
    Color := New GxColor.CreateRGB(153,102,204);     
    // Create a brush
    Brush := New GxSolidBrush.Create(Color);
    // Set brush for the first scale  element
    Scale.First := Brush; 
    // Create cornflower color
    Color := New GxColor.CreateRGB(100,149,237);     
    // Create a brush
    Brush := New GxSolidBrush.Create(Color);
    // Set brush for the last scale element
    Scale.Last := Brush;
    // Recalculate scale
    Scale.AutoSetupScaleItems;
    // Save changes made in express report 
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the scale is recalculated based on the specified number of intervals, and gradients are also set up for scale elements based on the colors that are set for the first and last scale elements.

See also:

IVZDataScale