IChartAxisLevelLineLabel.Font

Fore Syntax

Font: IGxFont;

Fore.NET Syntax

Font: Prognoz.Platform.Interop.Drawing.IGxFont;

Description

The Font property determines a label font.

Comments

To set a font color, use the IChartAxisLevelLineLabel.FontColor property.

Fore Example

Executing the example requires that the repository contains a regular report with the REG_REPORT_LABEL identifier. The report contains only a chart.

Add links to the Chart, Drawing, Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Report: IPrxReport;
    Tab: ITabSheet;
    Chart: IChart;
    LevelLs: IChartAxisLevelLines;
    LevelLine: IChartAxisLevelLine;
    LineLabel: IChartAxisLevelLineLabel;
    Pen: IGxPen;
Begin
    // Get access to repository
    MB := MetabaseClass.Active;
    // Get access to regular report
    Report := MB.ItemById("REG_REPORT_LABEL").Edit As IPrxReport;
    // Get table of regular report
    Tab := (Report.Sheets.Item(0As IPrxTable).TabSheet;
    // Get chart
    Chart := Tab.Objects.Item(0).Extension As IChart;
    // Add a level line
    Pen := New GxPen.CreateSolid(GxColor.FromKnownColor(GxKnownColor.Red), 0.40);
    LevelLs := Chart.AxisY.LevelLines;
    LevelLs.Add(0, Pen);
    LevelLine := LevelLs.Item(0);
    // Determine function that is used to build level line
    LevelLine.ValueFunction := ChartAxisLevelLineFunctionType.Median;
    // Display function value in the console window
    Debug.WriteLine(LevelLine.CalculatedValue);
    // Add a level line label
    LineLabel := LevelLine.Label;
    // Determine visibility of level line label
    LineLabel.Visible := True;
    //Set new parameters of level line label
    LineLabel.Font := New GxFont.Create("Arial"14, GxFontStyle.BoldItalic, GxUnit.Point);
    LineLabel.FontColor := New GxColor.CreateRGB(25500);
    LineLabel.MaskText := "Function type - %Computation; " + "Value  - %Value";
    // Save changes in report
    (Report As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a level line is added in the regular report. Color and width are set for the line, visibility, font, color and mask are set for the label. The console window displays function value.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

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

Public Shared Sub Main(Params: StartParams);
Var
        MB: IMetabase;
        Report: IPrxReport;
        Tab: ITabSheet;
        Chart: IChart;
        LevelLs: IChartAxisLevelLines;
        LevelLine: IChartAxisLevelLine;
        LineLabel: IChartAxisLevelLineLabel;
        Pen: GxPen = New GxPenClass();
        GxColorCls: GxColorClass = New GxColorClassClass();
        Font: GxFont = New GxFontClass();
        Color: GxColor;
Begin
        // Get access to repository
        MB := Params.Metabase;
        // Get access to regular report
        Report := MB.ItemById["REG_REPORT_LABEL"].Edit() As IPrxReport;
        // Get regular report table
        Tab := (Report.Sheets.Item[0As IPrxTable).TabSheet;
        // Get chart
        Chart := Tab.Objects.Item[0].Extension As IChart;
        // Add a level line
        Pen.CreateSolid(GxColorCls.FromName("Red"), 0.40);
        LevelLs := Chart.AxisY.LevelLines;
        LevelLs.Add(0, Pen);
        LevelLine := LevelLs.Item(0);
        // Determine function that is used to build level line
        LevelLine.ValueFunction := ChartAxisLevelLineFunctionType.callftMedian;
        // Display function value in the console window
        System.Diagnostics.Debug.WriteLine(LevelLine.CalculatedValue);
        // Add a level line label
        LineLabel := LevelLine.Label;
        // Determine visibility of level line label
        LineLabel.Visible := True;
        //Determine new parameters of level line label
        Font := LineLabel.Font;
        Font.Create("Arial"12, GxFontStyle.gfsBold, GxUnit.guPoint);
        Color := LineLabel.FontColor;
        Color.CreateRGB(25000);
        LineLabel.MaskText := "Function type - %Computation; " + "Value  - %Value";
        // Save changes to report
        (Report As IMetabaseObject).Save();
End Sub;

See also:

IChartAxisLevelLineLabel