This document describes how to add a XRChart control based on a common series template.
Open an existing reporting application or create a new one from scratch to get started with this tutorial.
The report created in this tutorial is platform-agnostic. You can use it in any supported platform's applications.
Do the following to add a chart control to a report:
After you drop the chart, the Chart Designer is automatically invoked if its "Display the designer every time a new chart is added" option is enabled. Click Cancel to close the window.
The invoked Data Source Wizard allows you to assign a data source to the chart. Bind the chart to the GSP database's GSP table as described in the Bind a Report to a Database topic (the gsp.mdb file in the DevExpress demos directory).
After the data source is created, it is assigned to the chart's DataSource property.
Invoke the chart's smart tag, open the XRChart.DataMember property's drop-down list and select the GSP item.
When a report has its XtraReportBase.DataSource property specified, the Detail band is repeated in the Preview as many times as there are records in the report data source. Set the DataSource property to None if you do not want to repeat the chart on each report page.
Do the following to specify series data and adjust the series template:
Click the chart's smart tag and click Run Designer in the invoked actions list.
In the invoked Chart Designer, go to the Data tab to the right of the designer's window. Select an existing data source in the corresponding drop-down list and drag-and-drop required data fields to the corresponding cells.
The Series cell specifies a data field that should provide data for series names. A new series should be created for each record in this data field. Use the Argument and Value cells to define where to get data for point arguments and values.
Switch to the Properties tab and expand the Series Template option. As you can see, the SeriesBase.ArgumentDataMember and SeriesBase.ValueDataMembers properties are automatically assigned to the corresponding data fields. Make sure that the SeriesBase.ArgumentScaleType and SeriesBase.ValueScaleType properties are set to appropriate values.
Perform the following customization to improve the chart's appearance:
You can switch to the Preview tab in Visual Studio to preview your report.
See Cross-Platform Reporting to learn how to preview, print, and/or export reports in different platforms.