ItemValue(Value: Double): Variant;
ItemValue[Value: System.Double]: System.Object;
Value. The value, according to which a visualizer scale element is to be obtained.
The ItemValue property returns scale elements corresponding to the specified value.
The property returns the brush, described in the interface IGxBrush or numeric value depending on the scale type.
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 Drawing, Express, Metabase and Visualizators system assemblies. The selected procedure should be called from the Main entry point.
Calculate the average value of the scale an determine color of the bubble corresponding to this value:
Sub UserProc;
Var
Metabase: IMetabase; // Metabase
Analyzer: IEaxAnalyzer; // Express report
Scale: IVZDataScale; // Scale
Value: Double; // Average value of the scale
Item: IGxSolidBrush; // Brush for scale elements
Begin
// Get metabase object
Metabase := MetabaseClass.Active;
// Get express report object
Analyzer := Metabase.ItemById("EXP").Edit As IEaxAnalyzer;
// Get bubble tree color scale
Scale := Analyzer.BubbleTree.BubbleTree.ColorVisual.ColorMapping.Scale;
// Get average value of the scale
Value := (Scale.MaxValue - Scale.MinValue) / 2;
Debug.WriteLine("Scale average value: " + Value.ToString);
// Determine the scale bubble corresponding to average value
Item := Scale.ItemValue(Value);
Debug.WriteLine("Bubble color for average value: (" +
Item.Color.R.ToString + ", " + Item.Color.G.ToString + ", " +
Item.Color.B.ToString + ")");
End Sub UserProc;
After executing the example, the browser console window displays scale average value and color of the bubble corresponding to this value:
Scale average value: 22.5
Bubble color for average value: (255, 70, 44)
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 Drawing, Express, Metabase and Visualizators assemblies should be imported to this module from the Prognoz.Platform.Interop system assembly.
Calculate the average value of the scale an determine color of the bubble corresponding to this value:
Public Shared Sub Main(Params: StartParams);
Var
Metabase: IMetabase; // Metabase
Analyzer: IEaxAnalyzer; // Express report
Scale: IVZDataScale; // Scale
Value: Double; // Average value of the scale
Item: IGxSolidBrush; // Brush for scale elements
Begin
// Get metabase object
Metabase := Params.Metabase;
// Get express report object
Analyzer := Metabase.ItemById["EXP"].Edit() As IEaxAnalyzer;
// Get bubble tree color scale
Scale := Analyzer.BubbleTree.BubbleTree.ColorVisual.ColorMapping.Scale;
// Get average value of the scale
Value := (Scale.MaxValue - Scale.MinValue) / 2;
System.Diagnostics.Debug.WriteLine("Average value of the scale: " +
Value.ToString());
// Determine the scale bubble corresponding to average value
Item := Scale.ItemValue[Value] As IGxSolidBrush;
System.Diagnostics.Debug.WriteLine("Bubble color for average value: (" +
Item.Color.R.ToString() + ", " + Item.Color.G.ToString() + ", " +
Item.Color.B.ToString() + ")");
End Sub;
The result of the executed example is the same as that, executed for Fore language.
See also: