IChartExternLegendItem.Visible

Fore Syntax

Visible: Boolean;

Fore.NET Syntax

Visible: System.Boolean;

Description

The Visible property determines whether the chart legend element is displayed.

Comments

By default this property is set to True, and the element is displayed in the external legend. Choosing False hides the element.

Fore Example

To execute this example, create a regular report with a chart and an external legend on the report sheet. A module is to be added to the report and the UserProc procedure is called from this module using the hyperlink. The inspector of module assemblies should contain links to the Chart, Report and Tab system assemblies.

Sub UserProc;
Var
    ChartExLegend: IChartExternLegend;
    Elements: IChartExternLegendItems;
    Element: IChartExternLegendItem;
    i: Integer; 
Begin
    ChartExLegend := (PrxReport.ActiveReport.ActiveSheet As IPrxTable).TabSheet.Objects.Item(1).Extension As IChartExternLegend;
    Elements := ChartExLegend.InternalItems;
    For i := 0 To Elements.Count-1 Do
        Element := Elements.Item(i);
        If Element.Visible=False Then
            Element.Visible := True
        End If;
    End For;
End Sub UserProc;

If the chart legend has hidden elements, they are to be displayed.

Fore.NET Example

To execute this example, create a regular report with a chart and an external legend on the report sheet. The .NET assembly is added to the report to handle report events. The OnBeforeOpenReport event is described in the module of the specified assembly in the EventsClass class. Add links to the Chart and Tab system assemblies.

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

Public Override Sub OnBeforeOpenReport(Report : IPrxReport; Var Cancel : Boolean);
Var
    ChartExLegend: IChartExternLegend;
    Elements: IChartExternLegendItems;
    Element: IChartExternLegendItem;
    i: Integer; 
Begin
    Cancel := False;
    ChartExLegend := (Report.ActiveSheet As IPrxTable).TabSheet.Objects.Item[2].Extension As IChartExternLegend;
    Elements := ChartExLegend.InternalItems;
    For i := 0 To Elements.Count-1 Do
        Element := Elements.Item[i];
        If Element.Visible=False Then
            Element.Visible := True
        End If;
    End For;
End Sub OnBeforeOpenReport;

If the chart legend has hidden elements, they are to be displayed.

See also:

IChartExternLegendItem