DefaultSerie: IChartSerieBase;
DefaultSerie: Prognoz.Platform.Interop.Chart.IChartSerieBase;
The DefaultSerie property determines default data series settings.
The default series settings are used by all new created chart series and the series that do not have any settings.
Executing the example requires that the repository contains a regular report with the REPORT identifier. The chart is created on report active sheet.
Add links to the Chart, Drawing, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Rep: IPrxReport;
Tab: ITabSheet;
Chart: IChart;
Serie: IChartSerieBase;
Shadow: IChartShadow;
Begin
Mb := MetabaseClass.Active;
Rep := Mb.ItemById("REPORT").Edit As IPrxReport;
Tab := (Rep.ActiveSheet As IPrxTable).TabSheet;
Chart := Tab.Objects.Item(0) As IChart;
Tab.BeginUpdate;
//Set up default series
Serie := Chart.Series.DefaultSerie;
Serie.DefaultLabel.Position := ChartLabelPosition.AutoPlacement;
Serie.Is3DBorder := True;
Serie.DisplayShadow := True;
Shadow := Serie.Shadow;
Shadow.Color := GxColor.FromKnownColor(GxKnownColor.DarkGray);
Shadow.Direction := New GxPointF.Create(0.5,0.5);
Tab.EndUpdate;
//Save report
(Rep As IMetabaseObject).Save;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Chart;
Imports Prognoz.Platform.Interop.Drawing;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
Rep: IPrxReport;
Tab: ITabSheet;
Chart: IChart;
Serie: IChartSerieBase;
Shadow: IChartShadow;
GxColorCls: GxColorClassClass = New GxColorClassClass();
DirPoint: GxPointF = New GxPointFClass();
Begin
Mb := Params.Metabase;
Rep := Mb.ItemById["REPORT"].Edit() As IPrxReport;
Tab := (Rep.ActiveSheet As IPrxTable).TabSheet;
Chart := Tab.Objects.Item[0] As IChart;
Tab.BeginUpdate();
//Set up default series
Serie := Chart.Series.DefaultSerie;
Serie.DefaultLabel.Position := ChartLabelPosition.clpAutoPlacement;
Serie.Is3DBorder := True;
Serie.DisplayShadow := True;
Shadow := Serie.Shadow;
Shadow.Color := GxColorCls.FromKnownColor(GxKnownColor.clDarkGray);
DirPoint.Create(0.5,0.5);
Shadow.Direction := DirPoint;
Tab.EndUpdate();
//Save report
(Rep As IMetabaseObject).Save();
End Sub;
On executing the example the default chart series settings will be modified: series labels will be placed automatically, 3D style of series borders will be used and the shadow will be displayed for series.All chart series for which settings are not defined will use the specified settings.
See also: