Font: IGxFont;
Font: Prognoz.Platform.Interop.Drawing.GxFont;
The Font property determines text font for external chart legend.
Executing the example requires a regular report with the Report identifier. The report includes the following objects: a chart and an external legend.
Sub Main;
Var
mb: IMetabase;
rep: IPrxReport;
legend: IPrxChartLegend;
chartlegend: IChartExternLegend;
items: IChartExternLegendItems;
chartF: IGxFont;
Begin
mb:= MetabaseClass.Active;
rep := mb.ItemById("OBJ42859").Edit As IPrxReport;
legend:= ((rep.ActiveSheet As IprxTable).TabSheet.Objects.Item(1)) As IPrxChartLegend;
chartlegend:= legend As IChartExternLegend;
chartlegend.AxisIcon:= ChartLegendAxisIcon.Axis;
chartF:= New GxFont.Create("Arial", 8);
chartlegend.Font:= chartF;
items:= chartlegend.InternalItems;
(rep As IMetabaseObject).Save;
End Sub Main;
After executing the example the font parameters of the text of the chart external legend are the following: Arial, 8.
Executing the example requires a regular report with the Report identifier. The report includes the following objects: a chart and an external legend.
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.ForeSystem;
...
Public Sub Main(Params: StartParams);
Var
mb: IMetabase;
rep: IPrxReport;
legend: IPrxChartLegend;
chartlegend: IChartExternLegend;
objects: ITabObjects;
chartF: GxFontClass;
Begin
mb := Params.Metabase;
rep := mb.ItemById["OBJ42859"].Edit() As IPrxReport;
objects := (rep.ActiveSheet As IprxTable).TabSheet.Objects;
legend := (objects.Item[1]) As IPrxChartLegend;
chartlegend := legend As IChartExternLegend;
chartlegend.AddChart(objects.Item[2] As DxChart);
chartlegend.UseSerieIcon := False;
chartF:= New GxFontClass();
chartF.Create("Arial", 8, GxFontStyle.gfsRegular, GxUnit.guPoint);
chartlegend.Font:= chartF;
(rep As IMetabaseObject).Save();
End Sub;
After executing the example the font parameters of the text of the chart external legend are the following: Arial, 8.
See also: