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

The property is set to True by default, and the element is displayed in the external legend. When the property is set to False, the element is hidden.

Fore Example

Executing the example requires a regular report with a chart and an external legend on the report sheet. A unit is added to the report and the UserProc procedure is called from this unit using the hyperlink. The inspector of unit assemblies must contain links to the Chart, Report, 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 displayed.

Fore.NET Example

Executing the example requires 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 unit 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 displayed.

See also:

IChartExternLegendItem