EaxChart: IEaxChart;
The EaxChart property determines a chart, which data source is analytical data area.
To determine chart source type, use the IPrxChart.SourceType property.
Executing the example requires a regular report with the REGULAR_REPORT identifier. Analytical data area is located on the report sheet.
Add links to the Drawing, Express, Metabase, Report, Tab, Topobase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Report: IPrxReport;
Table: IPrxTable;
TabObj: ITabObjects;
Placement: IGxRectF;
prx_chart: IPrxChart;
DArea: IEaxDataArea;
eax_da: IEaxDataAreaViews;
eax_obj: IEaxObject;
eax_chart: IEaxChart;
Begin
MB := MetabaseClass.Active;
Report := MB.ItemById("REGULAR_REPORT").Edit As IPrxReport;
Table := Report.ActiveSheet As IPrxTable;
TabObj := Table.TabSheet.Objects;
TabObj.Clear;
Placement := New GxRectF.Create(10, 10, 150, 100);
// Create a new chart and set up chart parameters
prx_chart := TabObj.Add("PrxChart", Placement).Extension As IPrxChart;
prx_chart.SourceType := PrxChartSourceType.EaxChart;
prx_chart.Name := "Data for all the time";
// Chart data source:
DArea := Report.DataArea;
eax_da := DArea.Slices.Item(0).Views;
eax_obj := eax_da.AddByType(EaxObjectType.Chart);
eax_chart := eax_obj As IEaxChart;
eax_chart.Visible := True;
eax_chart.Enabled := True;
prx_chart.EaxChart := eax_chart;
(Report As IMetabaseObject).Save;
End Sub UserProc;
After executing the example a chart is added to regular report sheet, chart data source is analytical data area.
See also: