This document provides an example that demonstrates how to add a chart to a report, how to provide data for the chart series, and how to set up a chart's elements.
In this example, series data has a single data source. You can also use different data sources for different series.
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 Wizard is automatically invoked if its "Display the designer every time a new chart is added" option is enabled. Close the wizard at this step.
After the data source is created, it is assigned to the chart's DataSource property.
Click the chart's smart tag, open the drop-down list for the XRChart.DataMember property and select the Products 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. Make sure that the DataSource property is set to None in your report if you do not want to repeat the chart on each report page.
Do the following to add a series to the chart and specify data binding properties:
Click the chart's smart tag and click Run Designer in the invoked action list.
In the invoked Chart Wizard, follow the steps below to add a new series to the chart control.
Populate the created series with points.
The Properties tab displays the Argument Data Member and Value Data Members settings that are automatically assigned to the corresponding fields.
Filter series data.
Create and adjust the filter criteria in the invoked dialog.
Click Close to save changes and close the dialog,
Do the following to see how the chart looks when it is populated with data:
Return to the Report Designer and invoke the Chart Designer. The chart axes are now populated with actual data and you can customize the chart.
Apply the following adjustments to improve the chart's appearance:
Remove the chart's legend (the chart series are bound to the same data).
Select the Label node under this series and disable the Visibility check box to hide Series1's point labels.
Switch to the Preview tab to preview your report.