Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Creating Charts
    [Collapse]Chart Elements
     [Expand]Series
     [Collapse]Diagram
       Diagram Overview
       Simple Diagram
       Swift Plot Diagram
       XY-Diagram
       Gantt Diagram
       Radar and Polar Diagrams
       Simple Diagram 3D
       XY-Diagram 3D
       Funnel Diagram 3D
     [Expand]Axes
     [Expand]Panes
     [Expand]Legend
     [Expand]Chart Titles
     [Expand]Annotations
     [Expand]Indicators
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Diagram Overview

This document details the use of a diagram in the ASP.NET Chart Control: its purpose, implementation and capabilities. Before read this text, it may be useful to review the basic concepts of the chart, which are described in the following document: Charting Basics.

This document consists of the following sections.

Expanded Diagram Overview

The diagram is one of the most basic of a chart's elements, along the same line as series, chart titles and legend. Architecturally, the diagram is a parent for a chart's panes and axes, and visually - it encloses a chart's series as well. Despite the fact that series do not formally belong to the Diagram object (instead, they reside in the WebChartControl's SeriesCollection), they are stiffly interdependent with the diagram's type, and are visually displayed within the diagram's bounds. To view the ASP.NET Chart Control architecture schematically, refer to Chart Elements.

Note that it is only possible to have a single diagram object for each chart. However, within the same diagram (of the XY-Diagram type), you can plot multiple panes, as shown in the image above. For details, refer to Panes Overview.

The diagram's most significant characteristic is its type. The type of the diagram depends on the view type of the chart's series. By default, it is automatically determined by the view type of the first visible series in the chart's collection. Note that the Diagram object is equal to null (Nothing in Visual Basic) until a chart has at least one series in its collection.

So, a diagram of each type can only display series of the appropriate view types. And, it is impossible to plot multiple series of incompatible view types within the same Diagram object (and therefore, within the same chart). To learn more on this, refer to Combining Different Series Views.

In addition, for each diagram type there is a unique set of available options and elements.

In the following list, the available diagram types are broken into several basic categories. For specific details on each diagram type, refer to the appropriate document.

To access almost any of the chart's elements (excepting its series, titles and legend), you should first access the diagram itself. How this is done (both at design and runtime), is briefly described in the following section of this document: Accessing the Diagram.

Expanded Accessing the Diagram

To access the diagram at design time, click your chart control, to select it. Then, in the Properties window, locate the WebChartControl.Diagram property, and expand it. You will see the list of available properties for this diagram type. Note that the set of these properties is dependent upon the diagram's type.

At runtime, a diagram is represented by an instance of the Diagram class, which can be accessed via the WebChartControl.Diagram property. To access a diagram's elements and properties, you should cast your diagram's instance to the specific diagram's type, as the following example demonstrates.

Note that if the diagram type to which you cast your diagram object is not appropriate (e.g. it has series of incompatible view types), an exception will be thrown.

Expanded See Also

How would you rate this topic?​​​​​​​