Data(elId: String): Variant;
Data[elId: string]: object;
elId. Identifier of the element, the value of which is to be obtained.
The Data property returns the value of selected element.
To determine data source, use the IVZDataSourceMapping.DataSource property.
Executing the example requires that the repository contains an express report with the EXPRESS identifier, which data source is created with the use of a dictionary with the TBL_DICTIONARY identifier. The Color metric should be selected in the bubble tree report.
Add links to the system assemblies: Drawing, Express, Metabase, Visualizators.
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(0, 255, 255);
// Initialize scale used to display data
DataSourceMapping.Setup;
Debug.WriteLine("Data source name: " +
DataSourceMapping.DataSource.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;
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:
Identifiers of data source, dimension, by which data is selected.
Fill color for the "no data" bubble.
After executing the example the console window displays data source name and identifier of the dimension, by which data is selected.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
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(0, 255, 255);
// Initialize scale used to display data
DataSourceMapping.Setup();
System.Diagnostics.Debug.WriteLine("Data source name: " +
DataSourceMapping.DataSource.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;
See also: