IChartLabel.Rectangle

Syntax

Rectangle: IGxRectF;

Description

The Rectangle property returns the chart label coordinates and size.

Example

To execute this example, create a regular report with the Rep_1 identifier with a chart on the report sheet. The inspector of unit assemblies should contain references to the Chart, Report, Tab and Metabase system assemblies.

Sub macro;
Var
    mb:Imetabase;
    report:IPrxReport;
    chart: IChart;
    series: IChartSeries;
    label: IChartLabel;
    Rect: IGxRectF;
Begin
    mb:= MetabaseClass.Active;
    report:= mb.ItemById("Rep_1").Open(NullAs IPrxReport;
    chart := (report.ActiveSheet As IPrxTable).TabSheet.Objects.Item(0).Extension As IChart;
    series := Chart.Series;
    label := series.Item(0).Label(0);
    Rect := label.Rectangle;
    Debug.WriteLine("Height:" + Rect.Height.ToString);
    Debug.WriteLine("Width:" + Rect.Width.ToString);
    Debug.WriteLine("Left border:" + Rect.Left.ToString);
    Debug.WriteLine("Top border:" + Rect.Top.ToString);
End Sub macro;

After executing the example, the console window displays the coordinates and size of the first label of the first series:

Height:4.3054685592651367
Width:7.0443191528320313
Left border:21.17462158203125
Top border:28.872674942016602

See also:

IChartLabel