This document introduces the basics of using the XRChart control in
XtraReports, and describes its main features.
Because in most aspects, XRChart duplicates all the general functionality of
the ChartControl,
for more detailed information on its use, see the XtraCharts documentation.
The XRChart control can only be used in XtraReports. To add charts to
your Windows® Forms and ASP.NET application, use the ChartControl
and WebChartControl
controls of the XtraCharts Suite, which should be purchased separately
from XtraReports.
The following sections are available in this document.
The XRChart
control visualizes the series of points using the
available 2D chart types or 3D chart types. The chart type is
defined via the View property of a series. And, a single chart can
display multiple series, if their view types are compatible.
The following image illustrates a 3D Pie chart.
A Chart contains multiple visual elements (diagram, axes,
titles, labels, strips, constant lines, etc.), for which design-time selection
is supported (since, they are not System.ComponentModel.Component descendants).
And, when any of these elements is selected, its properties are shown in the
Property Grid.
To provide data for a Chart, you first need to create a data source (any
object which implements either System.Collections.IList,
System.ComponentModel.IListSource or System.ComponentModel.IBindingList
interfaces), and then assign it to the XRChart.DataSource
property. And, if you want the data source to be auto-populated by the Chart (at
design and runtime), you should specify its XRChart.DataAdapter
property. Otherwise, you will need to manually populate it
This approach to data binding is useful when series names are separately
stored in a data source, so that all series can be auto-generated. To do this,
assign the data field that contains series names to the XRChart.SeriesDataMember
property. Then, specify the data fields used for series points arguments and
values, to the SeriesBase.ArgumentDataMember
and SeriesBase.ValueDataMembers
properties of the SeriesBase
object returned by the XRChart.SeriesTemplate
property.
The XRPivotGrid
control stands as a familiar data source to the Chart, meaning that you
can simply assign a Pivot Grid instance to a chart's XRChart.DataSource
property, for all data and layout settings to be defined automatically.