IChartExternLegendItems.Unify

Fore Syntax

Unify(Indexes: Array);

Fore.NET Syntax

Unify(System.Array);

Parameters

Indexes. Array of indexes of external legend elements.

Description

The Unify method enables the user to merge external legend elements, which indexes are passed as the Indexes input parameter.

Fore Example

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

Sub Main;
    Var
        mb: IMetabase;
        rep: IPrxReport;
        legend: IPrxChartLegend;
        chartlegend: IChartExternLegend;
        items: IChartExternLegendItems;
        a: array Of integer;
    Begin
        a := New integer[4];
        a[0] := 0;
        a[1] := 1;
        a[2] := 2;
        a[3] := 6;
        mb := MetabaseClass.Active;
        rep := mb.ItemById("OBJ12399").Open(NullAs IPrxReport;
        legend := (rep.ActiveSheet As IprxTable).TabSheet.Objects.Item(2).Extension As IPrxChartLegend;
        chartlegend := legend As IChartExternLegend;
        items := chartlegend.InternalItems;
        items.Unify(a);
End Sub Main;

After executing the example the first, second, third and seventh elements are merged.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;

...

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    rep: IPrxReport;
    legend: IPrxChartLegend;
    chartlegend: IChartExternLegend;
    items: IChartExternLegendItems;
    a: array Of integer;
Begin
    a := New integer[4];
    a[0] := 0;
    a[1] := 1;
    a[2] := 2;
    a[3] := 6;
    mb := Params.Metabase;
    rep := mb.ItemById["OBJ42859"].Edit() As IPrxReport;
    legend := (rep.ActiveSheet As IprxTable).TabSheet.Objects.Item[1].Extension As IPrxChartLegend;
    chartlegend := legend As IChartExternLegend;
    chartlegend.AxisIcon := ChartLegendAxisIcon.claiAxis;
    items := chartlegend.InternalItems;
    items.Unify(a);
    (rep As IMetabaseObject).Save();
End Sub;

After executing the example the first, second, third and seventh elements are merged.

See also:

IChartExternLegendItems