Visualizators > Visualizators Assembly Interfaces > IVZBaseDataVisualizer > IVZBaseDataVisualizer.Background
Background: IGxBrush;
The Background property determines brush settings for visualizer background.
To get an object for visualizer data formatting, use IVZBaseDataVisualizer.Formatter.
Executing the example requires:
An express report with the EXPRESS identifier containing a bubble tree.
The Graph.png graphic file located in the root of the C disk. Minimum image size is 200x200.
Add links to the Drawing, Express, Metabase, Visualizators system assemblies.
Sub UserProc;
Var
Metabase: IMetabase;
Analyzer: IEaxAnalyzer;
BubbleTree: IVZBaseDataVisualizer;
Formatter: IVZBaseFormatter;
Color: IGxColor;
Brush: IGxBrush;
Bitmap: IGxBitmap;
Image: IGxImage;
Graphics: IGxGraphics;
Rect: IGxRectF;
UnRed: IUndoRedo;
Begin
// Get repository
Metabase := MetabaseClass.Active;
// Get express report
Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
// Get bubble tree
BubbleTree := Analyzer.BubbleTree.BubbleTree As IVZBaseDataVisualizer;
// Change visualizer background brush settings
Color := GxColor.FromName("Yellow");
Brush := New GxSolidBrush.Create(Color);
BubbleTree.Background := Brush;
// Get percentage expression of the 0.425 number using the data formatting tool
Formatter := BubbleTree.Formatter;
Formatter.FormatByParam("{0}", 0.425, "0.00%");
Debug.WriteLine("The 0.425 number expressed as percentage: " + Formatter.FormatByParam("{0}", 0.425, "0.00%"));
// Enable visualizer animation
If Not BubbleTree.EnableAnimating Then
BubbleTree.EnableAnimating := True;
End If;
// Enable visualizer print mode
If BubbleTree.IsPrintMode Then
BubbleTree.IsPrintMode := False;
End If;
// Visualizer is unchanged
If BubbleTree.IsDirty Then
BubbleTree.IsDirty := False;
End If;
// Get change stack of visualizer settings
UnRed := BubbleTree.UndoRedo;
// Set availability and number of stack changes
UnRed.Enabled:= True;
UnRed.Limit:= 5;
// Save visualizer image to file
Bitmap := BubbleTree.GetBitmap(1795, 1205, 300);
Bitmap.SaveToFile("C:\Image.jpg");
// Render visualizer to graphic object
Image := New GxImage.CreateFromFile("C:\Graph.jpg");
Graphics := GxGraphicsClass.FromImage(Image);
Rect := New GxRectF.Create(100, 100, 100, 100);
BubbleTree.Draw(Graphics, Rect, 300, True);
// Refresh report and save changes
Analyzer.RefreshAll;
(Analyzer As IMetabaseObject).Save;
End Sub UserProc;
After executing the example for bubble tree:
Background becomes yellow.
The console window displays percentage of the 0.425 number by means of data formatting tool.
Animation is enabled.
Print mode is not available.
Changes of visualizer settings can be undone and redone only file times.
Before closing the report it is prompted to save changes only if the are made.
Visualizer image is saved to a file by the specified path.
Visualizer is rendered to the graphic file created from the specified image.
See also: