IChartLegend.ElementVerticalAlignment

Fore Syntax

ElementVerticalAlignment: ChartLegendElementVerticalAlignment;

Fore.NET Syntax

ElementVerticalAlignment: Prognoz.Platform.Interop.Chart.ChartLegendElementVerticalAlignment;

Description

The ElementVerticalAlignment property determines the type of vertical alignment of elements of the internal legend.

Comments

By default the center alignment (ChartLegendElementHorizontalAlignment.Center) is used.

Fore Example

To execute an example add references to the Chart, Metabase, Report, Tab system assemblies. It requires a regular report with OBJ_1 identifier. A report must contain two sheets: the first sheet contains a chart with internal legend, the second sheet contains a chart with external one.

Sub UserProc;
Var
    mb: IMetabase;
    report: IprxReport;
    legend: IChartLegend;
    externallegend: IChartExternLegend;
    chart: Ichart;
Begin
    mb := MetabaseClass.Active;
    report := Mb.ItemById("OBJ_1").Edit As IPrxReport;
    //Refer to internal legend
    chart := (report.Sheets.Item(0As IPrxTable).TabSheet.Objects.Item(0).Extension As Ichart;
    legend := chart.Legend;
    legend.ElementVerticalAlignment := ChartLegendElementVerticalAlignment.Bottom; //Bottom
    (report As IMetabaseObject).Save;
    //Refer to external legend
    externallegend := (report.Sheets.Item(1As IPrxTable).TabSheet.Objects.Item(1).Extension As IChartExternLegend;
    externallegend.ElementVerticalAlignment := ChartLegendElementVerticalAlignment.Top; //Top
    (report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the vertical alignment of elements inside the legend is changed: on the first sheet it is Bottom, on the second sheet it is Top.

Fore.NET Example

Executing the example requires a regular report with OBJ_1 identifier. A report must contain two sheets: the first sheet contains a chart with internal legend, the second sheet contains a chart with external one.

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

...

[STAThread]
Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    report: IprxReport;
    legend: IChartLegend;
    externallegend: IChartExternLegend;
    chart: Ichart;
Begin
    mb := Params.Metabase;
    report := Mb.ItemById["OBJ_1"].Edit() As IPrxReport;
    //Refer to internal legend
    chart := (report.Sheets.Item[0] As  IPrxTable).TabSheet.Objects.Item[0].Extension As Ichart;
    legend := chart.Legend;
    legend.ElementVerticalAlignment := Prognoz.Platform.Interop.Chart.ChartLegendElementVerticalAlignment.clevaBottom; //Bottom
    (report As  IMetabaseObject).Save();
    //Refer to external legend
    externallegend := (report.Sheets.Item[1] As  IPrxTable).TabSheet.Objects.Item[1]
.Extension As IChartExternLegend;
    externallegend.ElementVerticalAlignment := Prognoz.Platform.Interop.Chart.ChartLegendElementVerticalAlignment.clevaTop; //Top
    (report As  IMetabaseObject).Save();
End Sub;

After executing the example the vertical alignment of elements inside the legend is changed: on the first sheet it is Bottom, on the second sheet it is Top.

See also:

IChartLegend