Changing Chart Type and Setting Up Set of Series

Executing the example requires that the repository contains a workbook with the OBJ123 identifier in which the chart type and a data set to be displayed in the chart are changed. The report must display the chart.

Add links to the following system assemblies:

Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    MObj: IMetabaseObject;
    Exp: IEaxAnalyzer;
    Chart: IChart;
    Table: ITabSheet;
Begin
    MB := MetabaseClass.Active;
    //Open a workbook to edit
    MObj := MB.ItemById("OBJ123").Edit;
    Exp := MObj As IEaxAnalyzer;
    //Get a workbook chart
    Chart := Exp.Chart.Chart;
    //Change the chart type to bar chart
    Chart.Type := ChartType.Bars;
    //Get a workbook table
    Table := Exp.Grid.TabSheet;
    //Select the entire table in order all all rows contained in the table are displayed
    Table.View.Selection.SelectAll;
    MObj.Save;
End Sub UserProc;

After executing the example the chart type is changed to bar chart. All rows are selected in the table, therefore the data set displayed in the chart is changed.

See also:

Examples