Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Electrical

Chart with Static Series

  • Last UpdatedMar 30, 2022
  • 4 minute read

To create a report with a Chart control bound to a data source, so that a particular series has its own data source, proceed as follows.

This example describes how to construct a chart of products and their prices for a chosen category using the data from the Northwind database (the sample nwind.mdb database).

Note:
In this simple example, the series has a single data source. However, different data sources can be used for different series if required.

  • Create a new report.

  • Drag the Chart control from the Toolbox onto the report's Detail band.

    Note:
    The Chart Wizard may be displayed at this point (if its 'Show wizard every time a new chart is added' option is enabled). Click Cancel to close the wizard's window and manually customise the chart.

  • To bind the chart to a data source, click its Smart tag, and in the displayed actions list, expand the Data Source dropdown selector and click Add New DataSource. The Report Wizard is displayed.

    The wizard guides the user through the process of assigning a data source to the chart. For detailed instructions on the wizard's steps, refer to Bind a Report to Data, as this process is similar.

  • The specified data source is then assigned to the chart's Data Source property. The Data Member property is also set, which specifies which table or view of the dataset the chart should obtain data from, as is the Data Adapter property.

    Note:
    The report's Data Source property must be set to None. Otherwise, the chart will be blank when previewed.

  • To add a series to the chart and specify its data binding properties, use the Series Collection Editor. It can be displayed either via the Property Grid, or via the Series link in the chart's Smart tag.

    In the editor, create a series by clicking Add and selecting the Bar view.

    Switch to the Properties tab.

    Set the series' Data Source property to the created dataset, define the Argument Data Member and Value Data Members properties.

    Click Copy to create another series with the same properties, and set its View property to Point.

    To save the changes and close the editor, click Close.

    Note:
    After this step, there are maybe too many data points, making the chart difficult to interpret. The chart's Data Filters property is used to limit the number of data points shown by applying a filtering criterion. Click Series1 in the chart to select it, then in the Property Grid locate the Data Filters item and click the ellipsis to display the Data Filter Collection Editor.

  • Click Add to add a criterion, and define its properties as shown in the following image:

    To save the changes and close the editor, click Close.

    Repeat the same actions for Series2, i.e. choose its Data Filters property, add a filter and define its Column Name and Value.

  • To improve a chart's appearance a number of changes can be made, for example:

    • Remove the chart's legend, as it shows the same data for the series, select the legend item in the chart, and in the Property Grid, set its Visible property to No.

    • The point labels for Series1 are unnecessary, so select the label and set its Visible property to No.

    • Customise the Series2 marker's appearance. Replace the default circle with the upside-down triangle by the View.Point Marker Options.Kind property and set its Size to 12.

    • Rotate the X-axis labels for better readability. Click the AxisX item in the chart to select it, and the adjust properties for its labels (via the Label property). In this example, setting the Angle property is 20 and the Antialiasing property set to Yes, improves the appearance of the labels.

      It is possible to customise many other properties for the chart, which are not described here.

      The chart is now complete. Switch to the Preview tab to view the result.

For further information of another method of binding a chart to data, refer to Chart with Dynamic Series.

Related Links
TitleResults for “How to create a CRG?”Also Available in