corelibraries-devexpress-dot-xtrapivotgrid-09532aa7.md
Contains options controlling the display of the PivotGrid’s data in a ChartControl.
Namespace : DevExpress.XtraPivotGrid
Assembly : DevExpress.PivotGrid.v25.2.Core.dll
NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation
public class PivotGridOptionsChartDataSource :
PivotGridOptionsChartDataSourceBase
Public Class PivotGridOptionsChartDataSource
Inherits PivotGridOptionsChartDataSourceBase
The following members return PivotGridOptionsChartDataSource objects:
| Library | Related API Members |
|---|---|
| WinForms Controls | PivotGridControl.OptionsChartDataSource |
| .NET Reporting Tools | XRPivotGrid.OptionsChartDataSource |
A PivotGrid control’s data can be visualized in a ChartControl. Use the PivotGridControl.OptionsChartDataSource property to access the options controlling the display of data in a chart control.
The main options provided by the PivotGridOptionsChartDataSource class are:
To display a PivotGrid’s data in a chart control, set the chart control’s properties as follows:
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
//...
Imports 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
'...
Object ViewStatePersisterCore BaseOptions PivotGridOptionsBase PivotGridOptionsChartDataSourceBase PivotGridOptionsChartDataSource
See Also