IVZDataSourceMapping.Data

Syntax

Data(elId: String): Variant;

Data[elId: string]: object;

Parameters

elId. Identifier of the element, the value of which is to be obtained.

Description

The Data property returns the value of selected element.

Comments

To determine data source, use the IVZDataSourceMapping.DataSource property.

Example

Executing the example requires that the repository contains an express report with the EXPRESS identifier, which data source is built on a dictionary with the TBL_DICTIONARY identifier. The Color metric should be selected in the bubble tree report.

Add links to the Drawing, Express, Metabase, Visualizators system assemblies.

Sub UserProc;
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    BubbleTree: IVZBubbleTree;
    ColorVisual: IVZColorVisual;
    DataSourceMapping: IVZDataSourceMapping;
    DataSource: IVZMultiplyDataSource;
    Element: IGxSolidBrush;
Begin
    Metabase := MetabaseClass.Active;
    EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get color visualizer
    ColorVisual := BubbleTree.ColorVisual;
    // Get settings used for data mapping
    DataSourceMapping := ColorVisual.ColorMapping;
    // Set title for data source corresponding to identifier
    DataSource := DataSourceMapping.DataSource;
    DataSource.Title := DataSource.ID;
    DataSourceMapping.DataSource := DataSource;
    // Set index, according to which the data is returned from each dimension
    DataSourceMapping.Index := 1;
    // Set dimension identifier
    DataSourceMapping.AttributeId := "TBL_DICTIONARY";
    // Set color fill for the no data bubble
    Element := DataSourceMapping.Data(""As IGxSolidBrush;
    Element.Color := New GxColor.CreateRGB(0255255);
    // Initialize scale used to display data
    DataSourceMapping.Setup;
    Debug.WriteLine("Data source name: " + 
        DataSourceMapping.DataSource.Title);
    Debug.WriteLine("Name of selected dimension selection: " + 
        DataSourceMapping.Title);

    Debug.WriteLine("Index according to which the data is returned from each dimension: " + 
        DataSourceMapping.Index.ToString);
    Debug.WriteLine("Dimension ID according to which the data is selected: " + 
        DataSourceMapping.AttributeId);
    // Save changes to express report
    (EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Visualizators;
Imports Prognoz.Platform.Interop.Drawing;

Public Shared Sub Main(Params: StartParams);
Var
    Metabase: IMetabase;
    EaxAnalyzer: IEaxAnalyzer;
    BubbleTree: IVZBubbleTree;
    ColorVisual: IVZColorVisual;
    DataSourceMapping: IVZDataSourceMapping;
    DataSource: IVZMultiplyDataSource;
    Element: IGxSolidBrush;
Begin
    Metabase := Params.Metabase;
    EaxAnalyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
    // Get color visualizer
    ColorVisual := BubbleTree.ColorVisual;
    // Get settings used for data mapping
    DataSourceMapping := ColorVisual.ColorMapping;
    // Set title for data source corresponding to identifier
    DataSource := DataSourceMapping.DataSource;
    DataSource.Title := DataSource.ID;
    DataSourceMapping.DataSource := DataSource As VZMultiplyDataSource;
    // Set data mapping index from source
    DataSourceMapping.Index := 1;
    // Set dimension identifier
    DataSourceMapping.AttributeId := "D_SEP";
    // Set color fill for the no data bubble
    Element := DataSourceMapping.Data[""As IGxSolidBrush;
    Element.Color := New GxColor();
    Element.Color.CreateRGB(0255255);
    // Initialize scale used to display data
    DataSourceMapping.Setup();
    System.Diagnostics.Debug.WriteLine("Data source name: " + 
        DataSourceMapping.DataSource.Title);
    System.Diagnostics.Debug.WriteLine("Name of selected dimension  selection: " + 
        DataSourceMapping.Title);

    System.Diagnostics.Debug.WriteLine("Index, according to which data is returned: " + 
        DataSourceMapping.Index.ToString());
    System.Diagnostics.Debug.WriteLine("Dimension ID, according to which data is selected: " + 
        DataSourceMapping.AttributeId);
    // Save changes to express report
    (EaxAnalyzer As IMetabaseObject).Save();
End Sub;

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

After executing the example the following is set:

After executing the example the console window displays data source name and identifier of the dimension, by which data is selected.

See also:

IVZDataSourceMapping