Points: String;
The Points property determines address of the range, from which the names of the chart points are to be obtained.
Executing the example requires a chart in the regular report with the REGULAR_REPORT identifier, and data in the cells B4:F8, A4:A8 and B1:F1. Add links to the Metabase, Report, Tab, Drawing system assemblies.
Sub UserProc;
Var
Report: IPrxReport;
Chart: IPrxChart;
Sheet: ITabSheet;
MB: IMetabase;
Style: ITabCellStyle;
Arr: array Of integer;
i: integer;
Begin
//Connect to regular report
MB := MetabaseClass.Active;
Report := MB.ItemById("REGULAR_REPORT_POINTS").Edit As IPrxReport;
Sheet := (Report.Sheets.Item(0) As IPrxTable).TabSheet;
Chart := Sheet.Objects.Item(0).Extension As IPrxChart;
//Determine range of numeric values, series names and points names
Chart.Data := "B4:F8";
Chart.Series := "A4:A8";
Chart.Points := "B1:F1";
//Disable the "Change Ranges Automatically" function for chart data Chart.AutoAdjust := False;
//Range of data table, by which chart is built, is filled with specified color
Style := Chart.DataRange.Style;
Style.BackgroundColor := New GxColor.CreateRGB(164,199,252);
//Determine hidden data along category axis
Arr := Chart.ExcludedPoints;
Debug.WriteLine("Hidden points: ");
For Each i In Arr Do
Debug.WriteLine(Chart.PointNameByIndex(i));
End For;
//Disable the "Show Hidden Data" function for chart
Chart.IncludeHidden := False;
(Report As IMetabaseObject).Save;
End Sub UserProc;
Chart source data is changed in the regular report.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;
Imports Prognoz.Platform.Interop.Tab;
Imports Prognoz.Platform.Interop.Drawing;
Public Shared Sub Main(Params: StartParams);
Var
Report: IPrxReport;
Chart: IPrxChart;
Sheet: ITabSheet;
MB: IMetabase;
Style: ITabCellStyle;
BackgroundColor: GxColor;
Arr: Array;
i: integer;
Begin
//Connect to regular report
MB := Params.Metabase;
Report := MB.ItemById["REGULAR_REPORT_POINTS"].Edit() As IPrxReport;
Sheet := (Report.Sheets.Item[0] As IPrxTable).TabSheet;
Chart := Sheet.Objects.Item[0].Extension As IPrxChart;
//Determine range of numeric values, series names and points names
Chart.Data := "B4:F8";
Chart.Series := "A4:A8";
Chart.Points := "B1:F1";
//Disable the "Change Ranges Automatically" function for chart data Chart.AutoAdjust := False;
//Range of data table, by which chart is built, is filled with specified color
Style := Chart.DataRange.Style;
BackgroundColor := New GxColor();
BackgroundColor.CreateRGB(164, 199, 252);
Style.BackgroundColor := BackgroundColor;
//Determine hidden data along category axis
Arr := Chart.ExcludedPoints;
System.Diagnostics.Debug.WriteLine("Hidden points: ");
For Each i In Arr Do
System.Diagnostics.Debug.WriteLine(Chart.PointNameByIndex[i]);
End For;
//Disable displaying of hidden data
Chart.IncludeHidden := False;
(Report As IMetabaseObject).Save();
End Sub;
See also: