IVZTreeMap.TextVisual

Syntax

TextVisual: IVZTextVisual;

Description

The TextVisual property determines text visualizer.

Example

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

Next, capitalize first letters of entrant strings:

// Determine custom data transformer
Class MyAdapter: object, IVZDataAdapter
    // Capitalize first letters of all strings
    Function GetData(Value: Variant): Variant;
    Var 
        str: String;
        chr: Char;
    Begin
        str := Value As String;
        // Get the first character of the string
        chr := str.Chars(0);
        // Capitalize this character
        chr := Char.ToUpper(chr);
        // Get string with capital letter
        str := chr + str.SubString(1, str.Length -1);
        Return str;
    End Function GetData;
End Class MyAdapter;

Sub UserProc;
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    TreeMap: IVZTreeMap;
    TextVisual: IVZTextVisual;
    DataSourceMapping: IVZDataSourceMapping;
    DataTransformer: IVZDataAdapter;
Begin
    // Get the current repository
    Metabase := MetabaseClass.Active;
    // Get express report
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get tree map
    TreeMap := EaxAnalyzer.TreeMap.TreeMap;
    // Create new instance of text visualizer
    TextVisual := New VZTextVisual.Create;
    // Get data mapping settings
    DataSourceMapping := TextVisual.TextMapping;
    // Set the Data Transformer mapping type
    DataSourceMapping.MappingType := VisualizatorDataMappingType.DataMappingTransformer;
    // Create and set custom data transformer
    DataTransformer := New MyAdapter.Create;
    DataSourceMapping.DataTransformer := DataTransformer As IVZDataAdapter;
    Debug.WriteLine("String transformation:");
    Debug.IndentLevel := 1;
    Debug.WriteLine("Input: ""data analysis"", output: " + 
        (DataTransformer.GetData("prognoz"As String ));
    Debug.WriteLine("Input: ""tree map"", output: " + 
        (DataTransformer.GetData("tree map"As String ));
    // Set visualizer used to determine bubble tree element size
    TreeMap.TextVisual := TextVisual;
End Sub UserProc;

After executing the example, the custom data transformer is created, used to capitalize first letters of entrant strings:

String transformation:

    Input: "data analysis", output: Data analysis

    Input: "tree map", output: Tree map

See also:

IVZTreeMap