IVZIntervalsLegend.CellPadding

Syntax

CellPadding: IGxRectF;

Description

The CellPadding property determines the visualizer legend area, which contains items.

Comments

To determine horizontal and vertical element paddings inside the legend with intervals, use IVZIntervalsLegend.CellSpacing.

Example

Executing the example requires a form containing the components:

It is also required to have:

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

Sub UserProc;
Var
    Report: IPrxReport;
    TS: ITabSheet;
    Grid: IEaxGrid;
    Pos, CellPadPos: IGxRectF;
    Visualizer: IPrxVisualizerLegend;
    i: Integer;
    VZLegend: IVZIntervalsLegend;
    VZLegendBase: IVZLegendBase;
    Color: IGxColor;
    Pen: IGxPenBase;
    LegItem: IVZLegendItem;
    ResourceImage: IVZResourceImage;
Begin
    // Get regular report
    Report := UiReport1.Report;
    // Get active report sheet
    TS := (Report.ActiveSheet As IPrxTable) As ITabSheet;
    // Insert table legend to 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);
    // Get table legend with intervals
    VZLegend := Visualizer.PlacedControl As IVZIntervalsLegend;
    VZLegendBase := VZLegend As IVZLegendBase;
    // Create lines for header and footer
    Color := New GxColor.CreateRGB(1200120);
    Pen := New GxPen.CreateSolid(Color, 5);
    VZLegendBase.HeaderLine := Pen;
    VZLegendBase.Footer := VZLegendBase.Header;
    VZLegendBase.FooterLine := Pen;
    // Change location of objects inside tooltip and fill color
    CellPadPos := New GxRectF.Create(201001000);
    VZLegend.CellPadding := CellPadPos;
    VZLegend.ColorApplying := LegendColorApplying.Background;
    VZLegend.Style.Background := New GxSolidBrush.Create(GxColor.FromName("Yellow"));
    // Create a collection of legend items and add the first item to it
    VZLegend.Items := New VZLegendItems.Create;
    LegItem := New VZLegendItem.Create;
    LegItem.Text := "TEXT";
    LegItem.Color := GxColor.FromName("Blue");
    VZLegend.Items.Add(LegItem);
    // Align item left
    VZLegend.HorizontalCellsAligment := LegendItemsHorizontalAlignment.Right;
    // Create a legend marker and apply to legend item
    VZLegend.Marker := New VZIntervalsLegendMarker.Create;
    ResourceImage := New VZResourceImage.Create;
    ResourceImage.Bitmap := New GxBitmap.CreateFromFile("C:\Marker.png");
    VZLegend.Marker.Image := ResourceImage;
    VZLegend.Marker.Mask := ResourceImage;
    VZLegend.Marker.Marker := VisualizatorSizeMarkerShape.Custom;
    // Refresh visualizer
    Visualizer.Update;
End Sub UserProc;

After executing the example a map legend is created in the table cell range selected by a user. The legend has yellow background, one item aligned right, blue item marker. The marker is imported from the file.

See also:

IVZIntervalsLegend