Back to Devexpress

XYDiagramPaneBase Class

corelibraries-devexpress-dot-xtracharts-f18c61f8.md

latest7.9 KB
Original Source

XYDiagramPaneBase Class

Represents the base class for the XY-diagram pane objects.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public abstract class XYDiagramPaneBase :
    ChartElementNamed,
    IDisposable,
    IZoomablePane,
    IPane,
    IBackground,
    IDockTarget,
    ISupportTextAntialiasing,
    IXYDiagramPane,
    ILinearLayoutItem,
    IGridLayoutItem
vb
Public MustInherit Class XYDiagramPaneBase
    Inherits ChartElementNamed
    Implements IDisposable,
               IZoomablePane,
               IPane,
               IBackground,
               IDockTarget,
               ISupportTextAntialiasing,
               IXYDiagramPane,
               ILinearLayoutItem,
               IGridLayoutItem

The following members return XYDiagramPaneBase objects:

Remarks

The XYDiagramPaneBase class contains specific settings which can be used to customize the XYDiagramPane and XYDiagramDefaultPane objects.

For more information, refer to Panes.

Example

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, 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.

  4. Drop a button onto the form and add the following code to the Button1.Click event handler.

csharp
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;
        }
    }
}
vb
Imports System
Imports DevExpress.XtraCharts
Imports DevExpress.XtraEditors

Namespace TwoBoundSeriesInPanes
    Partial Public Class MainForm
        Inherits XtraForm

        Public Sub New()
            InitializeComponent()
            ' This line of code is generated by Data Source Configuration Wizard
            gspTableAdapter.Fill(gspDataSet.GSP)
        End Sub

        Private Sub OnFormLoad(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
            Dim year2003Series As New Series()
            year2003Series.Name = "2003"
            year2003Series.ArgumentDataMember = "Region"
            year2003Series.ValueDataMembers(0) = "GSP"
            year2003Series.FilterString = "[Year] == 2003"

            Dim year2004Series As New Series()
            year2004Series.Name = "2004"
            year2004Series.ArgumentDataMember = "Region"
            year2004Series.ValueDataMembers(0) = "GSP"
            year2004Series.FilterString = "[Year] == 2004"

            chartControl.Series.AddRange(year2003Series, year2004Series)

            Dim diagram As XYDiagram = CType(chartControl.Diagram, XYDiagram)
            Dim secondPane As New XYDiagramPane("Second Pane")
            diagram.Panes.Add(secondPane)

            Dim secondLegend As New Legend("Second Legend") With { _
                .DockTarget = secondPane, _
                .AlignmentHorizontal = LegendAlignmentHorizontal.Right, _
                .AlignmentVertical = LegendAlignmentVertical.Top _
            }
            chartControl.Legends.Add(secondLegend)

            Dim xyView As XYDiagramSeriesViewBase = CType(year2004Series.View, XYDiagramSeriesViewBase)
            year2004Series.Legend = secondLegend
            xyView.Pane = secondPane
        End Sub
    End Class
End Namespace

Implements

IDockTarget

Inheritance

Object ChartElement ChartElementNamed XYDiagramPaneBase XYDiagramDefaultPane

XYDiagramPane

See Also

XYDiagramPaneBase Members

Panes

How to: Create a Multi-Pane Chart

DevExpress.XtraCharts Namespace