Skip to main content

Understanding a Diagram

  • 2 minutes to read

This topic provides general information about a chart’s diagram, and the types available.

A diagram is a chart’s main area, which displays data and graphical elements (e.g., series, axes and panes), although some elements do not actually belong to the Diagram object (such as Series). For a complete list of chart elements, refer to Chart Elements.


A single chart control instance can only possess one diagram object. Its type is auto-determined by the view type of the first visible series in the chart’s collection. Each diagram type has a special set of options used to plot series compatible with that view type. For a complete list of available diagram types (with a description of each type), refer to the following help topic: Diagram.

At design time, you can use the WebChartControl.Diagram property to access the diagram’s options.


At runtime, to access a diagram’s properties, cast your instance of the Diagram object to a specific type, as demonstrated below.

using System;
using System.Web.UI;
using DevExpress.XtraCharts;
using DevExpress.XtraCharts.Web;

namespace WebChartControl {
    public partial class _Default : Page {
        protected void Page_Load(object sender, EventArgs e) {
            // Create a new ChartControl instance.
            WebChartControl webChartControl1 = new WebChartControl();

            // Access the diagram's properties.            
            ((XYDiagram)webChartControl1.Diagram).Rotated = true;
            ((XYDiagram)webChartControl1.Diagram).EnableAxisXScrolling = true;

The XYDiagram2D is the most common diagram type. It uses two axes to plot series, and supports multiple panes to display separate series. Axes and panes are discussed in greater detail in the next topic in this section: Understanding Axes and Panes.

For more information on diagrams, refer to the following help topic: Diagram Overview.