Background: IChartBackgroundInfo;
The Background property determines fill options for a data series.
Fill type is determined by the Type property. For each fill type there is a corresponding set of properties of the IChartBackgroundInfo interface.
Fill type application is limited by chart types described in the ChartBackgroundType enumeration.
Executing the example requires a histogram in regular report with the REGULAR_REPORT identifier. Add links to the Chart, Drawing, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Sheet: ITabSheet;
Chart: IChart;
Serie: IChartSerie;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
Sheet := (Report.Sheets.Item(0) As IPrxTable).TabSheet;
Chart := Sheet.Objects.Item(0).Extension As IChart;
Serie := Chart.Series.Item(0);
Serie.Background.Type := ChartBackgroundType.Gradient;
Serie.Background.Color := GxColor.FromName("Red");
Serie.Background.GradientColor := GxColor.FromName("Yellow");
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the chart series is filled with red and yellow gradient.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Chart;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Report: IPrxReport;
Sheet: ITabSheet;
Chart: IChart;
Serie: IChartSerie;
GxColorCls: GxColorClassClass = New GxColorClassClass();
Begin
MB := Params.Metabase;
Report := MB.ItemById["REGULAR_REPORT"].Edit() As IPrxReport;
Sheet := (Report.Sheets.Item[0] As IPrxTable).TabSheet;
Chart := Sheet.Objects.Item[0].Extension As IChart;
Serie := Chart.Series.Item[0];
Serie.Background.Type := ChartBackgroundType.cbtGradient;
Serie.Background.Color := GxColorCls.FromName("Red");
Serie.Background.GradientColor := GxColorCls.FromName("Yellow");
(Report As IMetabaseObject).Save();
End Sub;
See also: