AutoSetupScaleItems;
The AutoSetupScaleItems method recalculates visualizer scale based on values of the first and last scale elements.
The scale is calculated according to scale type:
Color is calculated for the color scale.
Values are calculated for the number scale.
Before calculating the scale, it is available to set the number of scale intervals.
Executing the example requires that the repository contains an express report with the EXPRESS identifier. Add links to the Drawing, Express, Metabase, Visualizators system assemblies.
Before executing the example, the color scale of bubble tree looks as shown on the IVZDataScale interface description page. Set the number of intervals equal to 4, determine brushes for the first and last scale elements, and then recalculate the scale:
Sub UserProc;
Var
Metabase: IMetabase;
EaxAnalyzer: IEaxAnalyzer;
BubbleTree: IVZBubbleTree;
Scale: IVZDataScale;
Color: IGxColor;
Brush: IGxSolidBrush;
Begin
// Get the current repository
Metabase := MetabaseClass.Active;
// Get express report
EaxAnalyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get bubble tree
BubbleTree := EaxAnalyzer.BubbleTree.BubbleTree;
// |Get bubble tree scale
Scale := BubbleTree.ColorVisual.ColorMapping.Scale;
// Set number of scale intervals
Scale.IntervalsCount := 4;
// Create amethyst color
Color := New GxColor.CreateRGB(153,102,204);
// Create a brush
Brush := New GxSolidBrush.Create(Color);
// Set brush for first scale element
Scale.First := Brush;
// Create cornflower color
Color := New GxColor.CreateRGB(100,149,237);
// Create a brush
Brush := New GxSolidBrush.Create(Color);
// Set brush for the last scale element
Scale.Last := Brush;
// Recalculate scale
Scale.AutoSetupScaleItems;
// Save changes made in express report
(EaxAnalyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the scale is recalculated based on the specified number of intervals, and gradients are also set up for scale elements based on the colors that are set for the first and last scale elements.
See also: