IChartExternLegend. AddChart

Syntax

AddChart(Value: IChart);

Parameters

Value. Value indicating the chart to be added to the list of charts connected to the external legend.

Description

The AddChart method adds a chart passed by the Value parameter to the list of charts connected to the external legend.

Example

Executing the example requires a regular report with the Report identifier. The report includes the following objects: two charts and an external legend.

Sub Main;
Var
    mb: IMetabase;
    rep: IPrxReport;
    legend: IPrxChartLegend;
    chartlegend: IChartExternLegend;
    objects: ITabObjects;
Begin
    mb := MetabaseClass.Active;
    rep := mb.ItemById("OBJ42859").Edit As IPrxReport;
    objects := (rep.ActiveSheet As IprxTable).TabSheet.Objects;
    legend := (objects.Item(1)) As IPrxChartLegend;
    chartlegend := legend As IChartExternLegend;
    chartlegend.AddChart(objects.Item(2As IChart);
    (rep As IMetabaseObject).Save;
End Sub Main;

After executing the example a new chart is added to the list of charts connected to the external legend.

See also:

IChartExternLegend