Back to Devexpress

How to: Create a Multi-Pane Chart

windowsforms-4863-controls-and-libraries-chart-control-examples-chart-elements-how-to-create-a-multi-pane-chart.md

latest2.5 KB
Original Source

How to: Create a Multi-Pane Chart

  • Feb 24, 2023
  • 3 minutes to read

The following example demonstrates how to create a chart with multiple series placed in separate panes.

For the purpose of simplicity, in this tutorial, data for the chart’s series is set manually. However, in the real-life charts, it’s possible to use any other type of a datasource.

This topic consists of the following sections:

Create a Chart and Provide Its Data

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

  2. Drop the ChartControl onto the form. Note that in this instance the Chart Wizard may be invoked (in case its “Show wizard every time a new chart is added” option is enabled). In this example, we don’t need to use the wizard, so click the Cancel button to close the wizard’s window and manually customize the ChartControl.

  3. In the Properties window, locate the Series item and click its ellipsis button. The Series Collection Editor dialog will be invoked.

Create and Customize Panes

  1. Select the Series2 element in the chart. Then, invoke the drop-down list of the Series2.View.Pane property, and click the New Pane button there. Now, a new pane (named Pane1 ) is created and the selected series is placed on it.

  2. Select the DefaultPane element, and set its Weight property to 1.5 , GridPaneLayout.Direction to Horizontal , XYDiagram.Rotated to true and XYDiagram2D.PaneDistance to 5.

  3. Select the Axis X element. In the Property window, locate the VisibleInPanes property and click its ellipsis button. In the invoked Axis Visibility dialog, check DefaultPane , so that only the current axis is shown in it.

Get the Result

The complete chart is shown in the following image.

See Also

Panes