IVZDataScale.Item

Syntax

Item(Index: Integer): Variant;

Parameters

Index. Scale element index.

Description

The Item determines the brush or the number, corresponding to a visualizer scale element, depending on its type.

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 Drawing, Express, Metabase and Visualizators system assemblies.

Before executing the example, the color scale of bubble tree looks as on it is shown on the IVZDataScale interface description page.

Sub UserProc;
Var
    Metabase: IMetabase; // Repository
    EaxAnalyzer: IEaxAnalyzer; // Express report
    EaxBubbleTree:IEaxBubbleTree;//Bubble tree
    BubbleTree: IVZBubbleTree; // Bubble tree
    Scale: IVZDataScale; // Color scale
    i: Integer; // Loop counter
    Color: IGxColor; // Step color
    Brush: IGxSolidBrush;// Brush for scale elements
Begin
    // Get repository object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    EaxBubbleTree := EaxAnalyzer.BubbleTree;
    BubbleTree := EaxBubbleTree.BubbleTree;
    // |Get bubble tree scale
    Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
    // Determine color of scale elements
    For i:=0 To Scale.ItemsCount - 1 Do       
        // Create red color
        Color := New GxColor.CreateRGB(255 - 50 * i, 00);     
        // Create a brush
        Brush := New GxSolidBrush.Create(Color);
        // Set brush to scale element
        Scale.Item(i) := Brush;
    End For;
    // Display information about scale
    Debug.WriteLine("Scale Identifier: " + Scale.ID);
    Debug.WriteLine("Total number of scale values: " + Scale.ValuesCount.ToString);
    Debug.WriteLine("Range of scale values: " + Scale.Value(0).ToString + " - " + Scale.Value(3).ToString);
    // Save changes made in express report 
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example different shades of red color are set for bubble tree scale elements:

The console displays scale identifier and total number of scale values:

Scale identifier: Scale220

Total number of scale values: 4

Range of scale values: 6.5034786623558 - 21.5011791813519

See also:

IVZDataScale