IVZBaseDataVisualizer.Background

Fore syntax

Background: IGxBrush;

Fore.NET syntax

Background: Prognoz.Platform.Interop.Visualizators.IGxBrush;

Description

The Background property determines brush settings for visualizer background.

Comments

To get an object for visualizer data formatting, use IVZBaseDataVisualizer.Formatter.

Fore example

Executing the example requires:

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;
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 settings of visualizer background brush
    Color := GxColor.FromName("Yellow");
    Brush := New GxSolidBrush.Create(Color);
    BubbleTree.Background := Brush;
    // Get percentage of the 0.425 number by means of tool for data formatting
    Formatter := BubbleTree.Formatter;
    Formatter.FormatByParam("{0}"0.425"0.00%");
    Debug.WriteLine("The 0.425 number expressed in percents: " + Formatter.FormatByParam("{0}"0.425"0.00%"));
    // Enable visualizer animation
    If Not BubbleTree.EnableAnimating Then
        BubbleTree.EnableAnimating := True;
    End If;
    // Disable visualizer print mode
    If BubbleTree.IsPrintMode Then
        BubbleTree.IsPrintMode := False;
    End If;
    // There are no changes in visualizer
    If BubbleTree.IsDirty Then
        BubbleTree.IsDirty := False;
    End If;
    // Save visualizer image to file
    Bitmap := BubbleTree.GetBitmap(17951205300);
    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(100100100100);
    BubbleTree.Draw(Graphics, Rect, 300True);
    // Refresh report and save changes
    Analyzer.RefreshAll;
    (Analyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example for bubble tree:

Fore.NET example

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;
    Analyzer: IEaxAnalyzer;
    BubbleTree: IVZBaseDataVisualizer;
    Formatter: IVZBaseFormatter;
    Color: GxColorClass = New GxColorClassClass();
    Brush: IGxBrush = New GxSolidBrushClass();
    Bitmap: IGxBitmap;
    Image: GxImage = New GxImageClass_2();
    Graphics: GxGraphicsClass = New GxGraphicsClassClass();
    Gr: GxGraphics;
    Rect: GxRectF = New GxRectFClass();
Begin
    // Get repository
    Metabase := Params.Metabase;
    // Get express report
    Analyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := Analyzer.BubbleTree.BubbleTree As IVZBaseDataVisualizer;
    // Change settings of visualizer background brush
    Color.FromName("Yellow");
    BubbleTree.Background := Brush;
    // Get percentage of the 0.425 number by means of tool for data formatting
    Formatter := BubbleTree.Formatter;
    Formatter.FormatByParam("{0}"0.425"0.00%");
    System.Diagnostics.Debug.WriteLine
    ("The 0.425 number expressed in percents: " + Formatter.FormatByParam("{0}"0.425"0.00%"));
    // Enable visualizer animation
    If Not BubbleTree.EnableAnimating Then
        BubbleTree.EnableAnimating := True;
    End If;
    // Disable visualizer print mode
    If BubbleTree.IsPrintMode Then
        BubbleTree.IsPrintMode := False;
    End If;
    // There are no changes in visualizer
    If BubbleTree.IsDirty Then
        BubbleTree.IsDirty := False;
    End If;
    // Save visualizer image to file
    Bitmap := BubbleTree.GetBitmap(17951205300);
    Bitmap.SaveToFile("C:\Image.jpg");
    // Render visualizer to graphic object
    Image.CreateFromFile("C:\Graph.jpg");
    Gr := Graphics.FromImage(Image);
    Rect.Create(100100100100);
    BubbleTree.Draw(Gr, Rect, 300False);
    // Refresh report and save changes
    Analyzer.RefreshAll();
    (Analyzer As IMetabaseObject).Save();
End Sub;

See also:

IVZBaseDataVisualizer