Item(Index: Integer): Variant;
Item[Index: System.Int32]: System.Object;
Index. Scale element index.
The Item determines the brush or the number, corresponding to a visualizer scale element, depending on its type.
Executing the example requires that the repository contains express report with the EXPRESS identifier. The Color metric should be selected in the bubble tree report. The module containing the example should have links to the Drawing, Express, Metabase and Visualizators system assemblies.
Before executing the example, the color scale of bubble tree looks as on it is shown on the IVZDataScale interface description page.
Sub UserProc;
Var
Metabase: IMetabase; // Repository
EaxAnalyzer: IEaxAnalyzer; // Express report
EaxBubbleTree:IEaxBubbleTree;//Bubble tree
BubbleTree: IVZBubbleTree; // Bubble tree
Scale: IVZDataScale; // Color scale
i: Integer; // Loop counter
Color: IGxColor; // Step color
Brush: IGxSolidBrush;// Brush for scale elements
Begin
// Get repository object
Metabase := MetabaseClass.Active;
// Get express report object
EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
EaxBubbleTree := EaxAnalyzer.BubbleTree;
BubbleTree := EaxBubbleTree.BubbleTree;
// |Get bubble tree scale
Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
// Determine color of scale elements
For i:=0 To Scale.ItemsCount - 1 Do
// Create red color
Color := New GxColor.CreateRGB(255 - 50 * i, 0, 0);
// Create a brush
Brush := New GxSolidBrush.Create(Color);
// Set brush to scale element
Scale.Item(i) := Brush;
End For;
// Display information about scale
Debug.WriteLine("Scale Identifier: " + Scale.ID);
Debug.WriteLine("Total number of scale values: " + Scale.ValuesCount.ToString);
Debug.WriteLine("Range of scale values: " + Scale.Value(0).ToString + " - " + Scale.Value(3).ToString);
// Save changes made in express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example different shades of red color are set for bubble tree scale elements:
The console displays scale identifier and total number of scale values:
Scale identifier: Scale220
Total number of scale values: 4
Range of scale values: 6.5034786623558 - 21.5011791813519
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Visualizators;
...
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase; // Repository
EaxAnalyzer: IEaxAnalyzer; // Express report
EaxBubbleTree:IEaxBubbleTree;//Bubble tree
BubbleTree: IVZBubbleTree; // Bubble tree
Scale: IVZDataScale; // Color scale
i: Integer; // Loop counter
Color: IGxColor; // Step color
Brush: IGxSolidBrush;// Brush for scale elements
Begin
// Get repository object
Metabase := Params.Metabase;
// Get express report object
EaxAnalyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
EaxBubbleTree := EaxAnalyzer.BubbleTree;
BubbleTree := EaxBubbleTree.BubbleTree;
// |Get bubble tree scale
Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
// Determine color of scale elements
For i:=0 To Scale.ItemsCount - 1 Do
// Create red color
Color := New GxColor();
Color.CreateRGB(255 - 50 * i, 0, 0);
// Create a brush
Brush := New GxSolidBrush();
Brush.Color := Color As GxColor;
// Set brush to scale elements
Scale.Item[i] := Brush;
End For;
// Display information about scale
System.Diagnostics.Debug.WriteLine("Scale identifier: " + Scale.ID);
System.Diagnostics.Debug.WriteLine("Total number of scale values: " + Scale.ValuesCount.ToString());
System.Diagnostics.Debug.WriteLine("Range of scale values: " + Scale.Value[0].ToString() + " - " + Scale.Value[3].ToString());
// Save changes made in express report
(EaxAnalyzer As IMetabaseObject).Save();
End Sub;
See also: