ItemValue(Value: Double): Variant;
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 unit containing the example should have links to the Drawing, Express, Metabase and Visualizators system assemblies. The specified 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;
Analyzer: IEaxAnalyzer;
Scale: IVZDataScale;
Value: Double;
Item: IGxSolidBrush;
Begin
// Get the current repository
Metabase := MetabaseClass.Active;
// Get express report
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)
See also: