[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Expand]Data Shaping
   [Collapse]Data Analysis
     Conditional Formatting
     Integration with the Chart Control
     Key Performance Indicators (KPIs)
   [Expand]Layout
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Appearance
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Integration with the Chart Control

The ChartControl can load and visualize data directly from the PivotGridControl control. The Pivot Grid contains a specific option set that configures how it provides its data. This guide explains how to configure the Pivot Charting bundle containing the Pivot Grid control and the Chart Control.

This topic contains the following sections:

Expanded Pivot Grid Data Providing Basics

The following code snippet demonstrates how to automatically create a Chart's series visualizing the Pivot Grid's data that the PivotGridControl.ChartDataSource property provides:

The following Pivot Grid options configure how the Pivot Grid initializes its chart data source:

Property Description
Incoming Data Format
PivotGridControl.ChartProvideDataByColumns Specifies whether the Pivot Grid initializes its Chart Data Source items' Series field using column values.
PivotGridControl.ChartProvideEmptyCells Specifies whether the Pivot Grid provides Chart Data Source items generated by cells that have empty values.
PivotGridControl.ChartFieldValuesProvideMode Specifies the value indicating which field values the Pivot Grid passes to a Chart.
PivotGridControl.ChartProvideCellValuesAsType Gets or sets the type to which Pivot Chart converts cell values to export them to a Chart.
PivotGridControl.ChartProvideColumnFieldValuesAsType Gets or sets the type to which Pivot Chart converts column field values to export them to a Chart.
PivotGridControl.ChartProvideRowFieldValuesAsType Gets or sets the type to which Pivot Chart converts row field values to export them to a Chart.
Pivot Grid Totals Treatment
PivotGridControl.ChartProvideColumnCustomTotals Gets or sets whether column custom totals should be passed to a chart control. This is a dependency property.
PivotGridControl.ChartProvideColumnGrandTotals Gets or sets whether column grand totals are passed to a chart control. This is a dependency property.
PivotGridControl.ChartProvideColumnGrandTotals Gets or sets whether column grand totals are passed to a chart control. This is a dependency property.
PivotGridControl.ChartProvideRowCustomTotals Gets or sets whether row custom totals should be displayed in a chart control. This is a dependency property.
PivotGridControl.ChartProvideRowGrandTotals

Gets or sets whether row grand totals are passed to a chart control. This is a dependency property.

PivotGridControl.ChartProvideRowTotals

Gets or sets whether row Totals are passed to a chart control. This is a dependency property.

Limiting the Series and Point Number
PivotGridControl.ChartMaxPointCountInSeries

Gets or sets the maximum allowed number of points in a series. This is a dependency property.

PivotGridControl.ChartMaxSeriesCount

Gets or sets the maximum allowed number of series in the chart data source. This is a dependency property.

Additional options
PivotGridControl.ChartSelectionOnly Gets or sets whether a chart control should visualize data from the selected cells only.
PivotGridControl.ChartUpdateDelay

Gets or sets the delay between changing the cell focus or selection, and updating the bound Chart control. This is a dependency property.

Note

The PivotGridControl.ChartMaxSeriesCount and PivotGridControl.ChartMaxPointCountInSeries properties' default values limit series' and series points' count. Set these properties to 0 to remove the limit.

Expanded Data Providing Specifics

The Pivot Grid provides its data to the Chart in the following manner if PivotGridControl.ChartProvideDataByColumns property is set to true:

  • The values of data members specifying columns to the ChartDataSource item's Series values.
  • The values of data members specifying rows to the ChartDataSource item's Argument values.
  • The summarized values to the ChartDataSource item's Series values.

Otherwise:

  • The values of data members specifying rows to the ChartDataSource item's Series values.
  • The values of data members specifying columns to the ChartDataSource item's Argument values.
  • The summarized values to the ChartDataSource item's Series values.

If multiple fields identify a column/row, the respective field values connected by the '|' sign construct the corresponding data member value (for example, '1995 | January').

When a Pivot Grid contains multiple data fields with different data types (PivotGridField.DataType), it converts Cell values to System.Decimal if possible; otherwise it sets its cell values to 0. Use the PivotGridControl.ChartProvideCellValuesAsType property to override this behavior specifying a data type to which Cell values should be converted.

The ChartControl supports only Numeric and DateTime series point values (see Series Scale Types to learn more). To convert cell values into an appropriate type manually, handle the PivotGridControl.CustomChartDataSourceData event.

When choosing a Chart type, note that only Series with a single value per Series point are supported.

Expanded Example

Is this topic helpful?​​​​​​​