IVZTreeMap.ColorVisual

Fore Syntax

ColorVisual: IVZColorVisual;

Fore.NET Syntax

ColorVisual: Prognoz.Platform.Interop.Visualizators.VZColorVisual;

Description

The ColorVisual property determines visualizer for data mapping of tree map data with color fill of their children.

Fore Example

Executing the example requires that the repository contains an express report with the EXP identifier. The module containing the example should have links to the Drawing, Express, Metabase and Visualizators system assemblies. The selected procedure should be called from the Main entry point.

Before executing the example, the tree map looks as shown on the IVZTreeMap interface description page. Set different shades of red as color fill in the tree map:

Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    TreeMap: IVZTreeMap; // Tree map
    ColorVisual: IVZColorVisual; // Color visualizator
 
    ColorMapping: IVZDataSourceMapping; // Settings for data mapping with colors
    Scale: IVZDataScale; // Color scale
    i: Integer; // Loop counter
    Item: IGxSolidBrush; // Color scale items
    Color: IGxColor;
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get tree map
    TreeMap := EaxAnalyzer.TreeMap.TreeMap;
     // Get color visualizer
    ColorVisual := TreeMap.ColorVisual;
    // Get settings for data mapping with colors
    ColorMapping := ColorVisual.ColorMapping;
    // Get color scale
    Scale := ColorMapping.Scale;
    // Iterate over all scale elements
    For i := 0 To Scale.ItemsCount - 1 Do
        // Get scale element
        Item := Scale.Item(i) As IGxSolidBrush;
        // Create red color
        Color := New GxColor.CreateRGB(255 - 40 * i, 00);
        // Set created color for current scale element
        Item.Color := Color;
    End For;
    // Set updated scale
    ColorMapping.Scale := Scale;
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example tree map leaves are colored with different shades of red:

Fore.NET Example

To execute the example, the repository must contain an express report with the EXP identifier. The selected procedure is the Main entry point in the Program module of the .NET assembly. The Drawing, Express, Metabase and Visualizators assemblies should be imported to this module from the Prognoz.Platform.Interop system assembly.

Before executing the example, the tree map looks as shown on the IVZTreeMap interface description page. Set different shades of red as color fill in the tree map:

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    TreeMap: IVZTreeMap; // Tree map
    ColorVisual: IVZColorVisual; // Color visualizator
 
    ColorMapping: IVZDataSourceMapping; // Settings for data mapping with colors
    Scale: IVZDataScale; // Color scale
    i: Integer; // Loop counter
    Item: IGxSolidBrush; // Color scale items
    Color: GxColor;
Begin
    // Get metabase object
    Metabase := Params.Metabase;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById["EXP"].Edit() As IEaxAnalyzer;
    // Get tree map
    TreeMap := EaxAnalyzer.TreeMap.TreeMap; 
    // Get color visualizator
    ColorVisual := TreeMap.ColorVisual;
    // Get settings for data mapping with colors
    ColorMapping := ColorVisual.ColorMapping;
    // Get color scale
    Scale := ColorMapping.Scale;
    // Iterate over all scale elements
    For i := 0 To Scale.ItemsCount - 1 Do
        // Get scale element
        Item := Scale.Item[i] As IGxSolidBrush;
        // Create red color
        Color := New GxColor();
        Color.CreateRGB(255 - 40 * i, 00);
        // Set created color for current scale element
        Item.Color := Color;
    End For;
    // Set updated scale
    ColorMapping.Scale := Scale As VZDataScaleClass;    
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save();
End Sub;

The result of the executed example is the same as that, executed for Fore language.

See also:

IVZTreeMap