IVZDataVisualizer.DataMappingToLegendAssignment

Fore Syntax

DataMappingToLegendAssignment(legend: IVZLegendBase): IVZDataVisual;

Fore.NET Syntax

DataMappingToLegendAssignment[legend: Prognoz.Platform.Interop.Vizualizators.IVZLegendBase]: Prognoz.Platform.Interop.Vizualizators.IVZDataVizual;

Parameters

legend. Legend object.

Description

The DataMappingToLegendAssignment property determines binding of bubble tree data to the legend.

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 Express, Metabase, Drawing and Visualizators system assemblies. The selected procedure should be called from the Main entry point.

Before executing this example, the bubble tree looks as shown on the IVZBubbleTree interface description page. Set a new background for the bubble tree, get a collection of legends and set a new font color for text elements of the legend. Then get color visualizer, set color fill for the no data bubble, and set color visualizer for the legend. Get the time line and set a new text font for time line text elements. Get bubble tree parameters as XML file and change orbits color. Display options of animation and active printing mode:

Sub UserProc;
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Legends: IVZLegends; // Legend collection
    Legend: IVZLegendBase; // Legend
    TimeLine: IVZTimeLine; // Time scale
    BubbleTreeXML: String; // Bubble tree settings in XML format
    DataVisual: IVZColorVisual; // Color visualizator 
    Brush: IGxSolidBrush; // Brush  
Begin
    // Get metabase object
    Metabase := MetabaseClass.Active;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get legends collection
    Legends := BubbleTree.Legends;
    // Get legend from collection
    Legend := Legends.Item(0);
    // Set new font color for legend text elements
    Legend.Style.FontColor := New GxColor.CreateRGB(000);
    // Get color visualizer    
    DataVisual := BubbleTree.ColorVisual;
    // Set color fill for the no data bubble
    Brush := DataVisual.ColorMapping.Data(""As IGxSolidBrush;
    If Brush <> Null Then
        Brush.Color := New GxColor.CreateRGB(00255);
    End If;
    // Set color visualizer for legend
    BubbleTree.DataMappingToLegendAssignment(Legend) := DataVisual.ColorMapping;
    // Get time line
    Timeline := BubbleTree.TimeLine;
    // Set new font color for time line text elements
    Timeline.Style.FontColor := New GxColor.CreateRGB(000);
    // Change orbit color
    BubbleTree.OrbitsPen.Color := New GxColor.CreateARGB(255,0,0,0);
    // Save express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a new font color for text elements of legend and time line is set, color of the "no data" bubble is set, orbit color is changed:

Also, the development environment console window shows options of animation and active printing mode:

Animation enabled: True

Active printing mode enabled: False

Fore.NET example

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

Before executing this example, the bubble tree looks as shown on the IVZBubbleTree interface description page. Set a new background for the bubble tree, get a collection of legends and set a new font color for text elements of the legend. Then get color visualizer, set color fill for the no data bubble, and set color visualizer for the legend. Get the time line and set a new text font for time line text elements. Get bubble tree parameters as XML file and change orbits color. Display options of animation and active printing mode:

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase; // Metabase
    EaxAnalyzer: IEaxAnalyzer; // Express report
    BubbleTree: IVZBubbleTree; // Bubble tree
    Legends: IVZLegends; // Legend collection
    Legend: IVZLegendBase; // Legend
    TimeLine: IVZTimeLine; // Time scale
    BubbleTreeXML: String; // Bubble tree settings in XML format
    FontColor: GxColor; // Font color
    DataVisual: IVZColorVisual; // Color visualizator 
    Brush: IGxSolidBrush; // Brush  
Begin
    // Get metabase object
    Metabase := Params.Metabase;
    // Get express report object
    EaxAnalyzer := Metabase.ItemById["EXP"].Edit() As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get legends collection
    Legends := BubbleTree.Legends;
    // Get legend from collection
    Legend := Legends.Item[0];
    // Set new font color for legend text elements
    FontColor := New GxColor();
    FontColor.CreateRGB(000);
    Legend.Style.FontColor := FontColor;
    // Get color visualizer     
    DataVisual := BubbleTree.ColorVisual;   
    // Set color fill for the no data bubble
    Brush := DataVisual.ColorMapping.Data[""As IGxSolidBrush;
    If Brush <> Null Then
        Brush.Color := New GxColor();
        Brush.Color.CreateRGB(00255);           
    End If;     
    // Set color visualizer for legend
    BubbleTree.DataMappingToLegendAssignment[Legend] := DataVisual.ColorMapping;
    // Get time line
    Timeline := BubbleTree.TimeLine;
    // Set new font color for time line text elements
    Timeline.Style.FontColor := FontColor;
    // Change orbit color
    BubbleTree.OrbitsPen.Color := New GxColor();
    BubbleTree.OrbitsPen.Color.CreateARGB(255,0,0,0);
    // 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:

IVZDataVisualizer