Back to Devexpress

How to: Link a Chart to the PivotGridControl's Data Source

windowsforms-5677-controls-and-libraries-chart-control-examples-creating-charts-providing-data-how-to-link-a-chart-to-the-pivotgridcontrols-data-source.md

latest2.6 KB
Original Source

How to: Link a Chart to the PivotGridControl's Data Source

  • Jan 15, 2024
  • 2 minutes to read

This tutorial demonstrates how you can link a ChartControl to a Pivot Grid Control at design time, and adjust the options of this bridged pair. For general information, see Pivot Charting (Integration with a Pivot Grid Control).

To link a chart to a pivot grid, do the following.

  1. Start Microsoft Visual Studio, and create a new Windows Forms Application , or open an existing one.

  2. Drop the PivotGridControl item from the DX.25.2: Data toolbox tab onto the form, and bind it to the “GSP” table in the gsp.mdb file that is shipped with the XtraCharts installation.

  3. Then, drop the ChartControl onto the same form, and set its ChartControl.DataSource property to the Pivot Grid instance.

  4. At this time, all the chart’s binding and layout settings are adjusted automatically, and you can launch the application, yielding the following result.

  5. To exclude the column grand totals from the chart, set the corresponding option in the chart’s ChartControl.PivotGridDataSourceOptions.

  6. If this result is not satisfactory, adjustments to the automatic options can be made (e.g. disable the AxisLabel.Staggered property of axis labels, and change the series view type to Line).

See Also

How to Visualize Pivot Grid Data in the Chart Control

How to Customize Pivot Grid Data before Displaying it in the Chart Control

How to Hide Unnecessary Series from the Chart (Pivot Grid - Chart Integration)

How to Print a Document that Contains Pivot Grid and Chart Controls