Skip to main content
A newer version of this page is available. .

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 a Diagram object (such as Series). For a complete list of chart elements, refer to Chart Elements.

IntroducingXtraCharts_Diagram

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 Diagram topic.

At design time, a diagram’s options can be accessed via the WebChartControl.Diagram property.

WebChartDiagramProperty

At runtime, to access a diagram’s properties, cast your instance of a 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;
        }
    }
}

Among the most common diagram types is the XYDiagram2D, which employs two axes to plot series, and supports multiple panes, in which separate series can be displayed. 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 Diagram Overview.