A newer version of this page is available. Switch to the current version.

XYDiagramPane() Constructor

Initializes a new instance of the XYDiagramPane class with the default settings.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v18.2.dll

Declaration

public XYDiagramPane()
Public Sub New

Remarks

This constructor is intended for serialization purposes only; so normally, you shouldn't use it in your code. Instead, you need to call the overloaded XYDiagramPane constructor with the name of the pane passed as the parameter. This will assign the specified string value to the ChartElementNamed.Name property of the new XYDiagramPane class instance.

Examples

This example demonstrates how to display a chart's series in separate panes.

For this example to work correctly, do the following.

  1. Start MS Visual Studio (2010, 2012 or 2013), and create a new Windows Forms Application, or open an existing one.
  2. Include all necessary assemblies to the References list of your project.
  3. Open the Solution Explorer window (e.g. by pressing CTRL+ALT+L), right-click the WindowsApplication1 item and in the invoked menu, point to Add and click Existing Item.... Then, locate the gsp.mdb file (it is shipped with XtraCharts suite and located in the directory, where you installed DevExpress demos) and click Add. In the displayed dialog, select the GSP table of this database.

    A dataset (named gspDataSet) is automatically created after performing the above steps.

  4. Drop a button onto the form and add the following code to the Button1.Click event handler.
using System;
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;

namespace TwoBoundSeriesInPanes {
    public partial class MainForm : XtraForm {
        public MainForm() {
            InitializeComponent();
            // This line of code is generated by Data Source Configuration Wizard
            gspTableAdapter.Fill(gspDataSet.GSP);
        }

        private void OnFormLoad(object sender, EventArgs e)
        {
            Series year2003Series = new Series();
            year2003Series.Name = "2003";
            year2003Series.ArgumentDataMember = "Region";
            year2003Series.ValueDataMembers[0] = "GSP";
            year2003Series.FilterString = @"[Year] == 2003";

            Series year2004Series = new Series();
            year2004Series.Name = "2004";
            year2004Series.ArgumentDataMember = "Region";
            year2004Series.ValueDataMembers[0] = "GSP";
            year2004Series.FilterString = @"[Year] == 2004";

            chartControl.Series.AddRange(year2003Series, year2004Series);

            XYDiagram diagram = (XYDiagram)chartControl.Diagram;
            XYDiagramPane secondPane = new XYDiagramPane("Second Pane");
            diagram.Panes.Add(secondPane);

            Legend secondLegend = new Legend("Second Legend") {
                DockTarget = secondPane,
                AlignmentHorizontal = LegendAlignmentHorizontal.Right,
                AlignmentVertical = LegendAlignmentVertical.Top
            };
            chartControl.Legends.Add(secondLegend);

            XYDiagramSeriesViewBase xyView = (XYDiagramSeriesViewBase)year2004Series.View;
            year2004Series.Legend = secondLegend;
            xyView.Pane = secondPane;
        }
    }
}
See Also