IVZColorLegendBase.Items

Fore syntax

Items: IVZLegendItems;

Fore.NET syntax

Items: Prognoz.Platform.Interop.Visualizators.VZLegendItems;

Description

The Items property determines collection of color legend items.

Comments

To determine whether the number of legend columns for color legend items is set automatically, use IVZColorLegendBase.AutoColumnsCount.

Fore example

Executing the example requires that the repository contains an express report with the EXPRESS identifier containing a bubble tree.

Add links to the Drawing, Express, Metabase, Visualizators system assemblies.

ub UserProc;
Var
    Metabase: IMetabase;
    Analyzer: IEaxAnalyzer;
    BubbleTree: IVZBubbleTree;
    ColorLegend: IVZColorLegendBase;
    IntervalsLegend: IVZIntervalsLegend;
    Items: IVZLegendItems;
    ItemO, ItemT: IVZLegendItem;
Begin
    // Get repository
    Metabase := MetabaseClass.Active;
    // Get express report
    Analyzer := Metabase.ItemById("EXPRESS").Edit As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := Analyzer.BubbleTree.BubbleTree;
    // Get tree color scale
    ColorLegend := BubbleTree.Legends.Item(0As IVZColorLegendBase;
    // Disable automatic number of columns
    ColorLegend.AutoColumnsCount := False;
    // Set number of columns
    IntervalsLegend := ColorLegend As IVZIntervalsLegend;
    IntervalsLegend.ColumnsCount := 1;
    // Create new items for bubble tree legend
    Items := New VZLegendItems.Create;
    ItemO := New VZLegendItem.Create;
    ItemT := New VZLegendItem.Create;
    ItemO.Text := "TEXT1";
    ItemO.Color := GxColor.FromName("Blue");
    ItemT.Text := "TEXT2";
    ItemT.Color := GxColor.FromName("Black");
    Items.Add(ItemO);
    Items.Add(ItemT);
    ColorLegend.Items := Items;
    // Refresh report and save changes
    Analyzer.RefreshAll;
    (Analyzer As IMetabaseObject).Save;
End Sub UserProc;

After executing the example two new differently colored items located in one column are displayed in the bubble tree color legend.

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: IVZBubbleTree;
    ColorLegend: IVZColorLegendBase;
    IntervalsLegend: IVZIntervalsLegend;
    Items: VZLegendItems;
    ItemO, ItemT: VZLegendItem;
    Color: GxColorClass = New GxColorClassClass();
Begin
    // Get repository
    Metabase := Params.Metabase;
    // Get express report
    Analyzer := Metabase.ItemById["EXPRESS"].Edit() As IEaxAnalyzer;
    // Get bubble tree
    BubbleTree := Analyzer.BubbleTree.BubbleTree;
    // Get tree color scale
    ColorLegend := BubbleTree.Legends.Item[0As IVZColorLegendBase;
    // Disable automatic number of columns
    ColorLegend.AutoColumnsCount := False;
    // Set number of columns
    IntervalsLegend := ColorLegend As IVZIntervalsLegend;
    IntervalsLegend.ColumnsCount := 1;
    // Create new items for bubble tree legend
    Items := New VZLegendItems();
    ItemO := New VZLegendItem();
    ItemT := New VZLegendItem();
    ItemO.Text := "TEXT1";
    Color.FromName("Blue");
    ItemO.Color := Color.FromName("Blue");
    ItemT.Text := "TEXT2";
    ItemT.Color := Color.FromName("Black");
    Items.Add(ItemO);
    Items.Add(ItemT);
    ColorLegend.Items := Items;
    // Refresh report and save changes
    Analyzer.RefreshAll();
    (Analyzer As IMetabaseObject).Save();
End Sub;

See also:

IVZColorLegendBase