IEaxGrid.Legends

Syntax

Legends: IVZLegends;

Description

The Legends property returns a collection of table legends.

Comments

To determine metric purpose in visualizer legend, use IEaxObject.IndicatorLegendAssignment.

Example

Executing the example requires that the repository contains form with the following components:

Regular report containing the table is required. One of table dimensions has the Background color metric type. Regular report is a data source for UiReport1.

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

Sub UserProc;
Var
    Report: IPrxReport;
    TS: ITabSheet;
    Grid: IEaxGrid;
    Pos: IGxRectF;
    Visualizer: IPrxVisualizerLegend;
    i: Integer;
Begin
    // Get regular report
    Report := UiReport1.Report;
    // Get active report sheet
    TS := (Report.ActiveSheet As IPrxTable) As ITabSheet;
    // Insert table legend in the report
    Pos := New GxRectF.Create(0000);
    Pos.Left := TS.View.Selection.Range.Location.X;
    Pos.Top := TS.View.Selection.Range.Location.Y;
    Pos.Width := TS.View.Selection.Range.Width;
    Pos.Height := TS.View.Selection.Range.Height;
    TS.Objects.Add("PrxVisualizerLegend", Pos);
    Visualizer := TS.Objects.Item(TS.Objects.Count - 1).Extension As IPrxVisualizerLegend;
    Grid := Report.DataArea.Views.Item(0As IEaxGrid;
    i := Grid.Legends.Add(Grid.IndicatorLegendAssignment(EaxGridIndicatorType.BackgroundColor));
    Visualizer.SetEaxObjectLegend(Grid, EaxGridIndicatorType.BackgroundColor);
End Sub UserProc;

After executing the example table legend will be created in table cell range selected by user.

See also:

IEaxGrid