Font: IGxFont;
Font: Prognoz.Platform.Interop.Drawing.GxFont;
The Font property determines parameters of font used for data labels.
Executing the example requires a regular report with a chart 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 and Drawing system assemblies.
Sub UserProc;
Var
Chart: IChart;
FontLabel: IGxFont;
FCLabel: IGxColor;
Begin
Chart := (PrxReport.ActiveReport.ActiveSheet As IPrxTable).TabSheet.Objects.Item(0).Extension As IChart;
Chart.Series.DisplayLabels := True;
FontLabel := New GxFont.Create("Arial Black", 15, 3 As GxFontStyle, 3 As GxUnit);
FCLabel := New GxColor.CreateARGB(255,0,126,255);
Chart.Series.DefaultLabel.Font := FontLabel;
Chart.Series.DefaultLabel.FontColor := FCLabel;
End Sub UserProc;
After executing the example, the Arial Black font of the specified style and size is applied to the label text.
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. The inspector of unit assemblies must contain links to the Chart, Report, Tab and Drawing system assemblies.
Public Override Sub OnBeforeOpenReport(Report:IPrxReport; Var Cancel:Boolean);
Var
Chart: IChart;
ColorCl: GxColorClass_2=New GxColorClass_2();
FontLabel: GxFontClass=New GxFontClass();
Begin
Chart := (Report.ActiveSheet As IPrxTable).TabSheet.Objects.Item[0].Extension As IChart;
Chart.Series.DisplayLabels := True;
ColorCl.CreateARGB(255, 0, 255,0);
FontLabel.Create("Arial Black", 20, 3 As GxFontStyle, 3 As GxUnit);
Chart.Series.DefaultLabel.Font := FontLabel;
Chart.Series.DefaultLabel.FontColor := ColorCl;
End Sub OnBeforeOpenReport;
After opening the report, the Arial Black font of the specified style and size is applied to the label text.
See also: