PivotGridControl.OptionsChartDataSource Property
Provides access to the options controlling the display of the PivotGrid control’s data in a chart control.
Namespace: DevExpress.XtraPivotGrid
Assembly: DevExpress.XtraPivotGrid.v17.2.dll
Declaration
[XtraSerializableProperty(XtraSerializationVisibility.Content, XtraSerializationFlags.DefaultValue)]
public PivotGridOptionsChartDataSource OptionsChartDataSource { get; }
Property Value
Type | Description |
---|---|
PivotGridOptionsChartDataSource | A PivotGridOptionsChartDataSource object that contains corresponding options. |
Remarks
The PivotGrid allows the data it displays to be visualized using a ChartControl. The PivotGrid provides data, and acts as a data source for other controls. It implements the IBindingList interface, and so bound controls are automatically updated when the PivotGrid control’s display information changes.
See the PivotGridOptionsChartDataSource topic to learn about binding a chart control to a PivotGrid control, and about available chart display options.
Example
The following code shows how to display a Pivot Grid Control’s data in a ChartControl.
If the PivotGridOptionsChartDataSourceBase.ProvideDataByColumns property is set to true, series in the chart control are created based on PivotGrid columns:
If the PivotGridOptionsChartDataSourceBase.ProvideDataByColumns property is set to false, series in the chart control are created based on PivotGrid rows:
using DevExpress.XtraCharts;
chartControl1.DataSource = pivotGridControl1;
chartControl1.SeriesDataMember = "Series";
chartControl1.SeriesTemplate.ArgumentDataMember = "Arguments";
chartControl1.SeriesTemplate.ValueDataMembers.AddRange(new string[] { "Values" });
// Format display values.
chartControl1.SeriesTemplate.PointOptions.ValueNumericOptions.Format = NumericFormat.Currency;
chartControl1.SeriesTemplate.PointOptions.ValueNumericOptions.Precision = 0;
pivotGridControl1.OptionsChartDataSource.ProvideDataByColumns = true;
//see image 1
//...
pivotGridControl1.OptionsChartDataSource.ProvideDataByColumns = false;
//see image 2
//...
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the OptionsChartDataSource property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.