IVZColorLegendBase.Items

Syntax

Items: IVZLegendItems;

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.

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.

See also:

IVZColorLegendBase