Back to Devexpress

WebChartControl.Diagram Property

aspnet-devexpress-dot-xtracharts-dot-web-dot-webchartcontrol-b5f59e00.md

latest3.5 KB
Original Source

WebChartControl.Diagram Property

Gets the web chart control’s diagram and provides access to its settings.

Namespace : DevExpress.XtraCharts.Web

Assembly : DevExpress.XtraCharts.v25.2.Web.dll

NuGet Package : DevExpress.Web.Visualization

Declaration

csharp
public Diagram Diagram { get; set; }
vb
Public Property Diagram As Diagram

Property Value

TypeDescription
Diagram

A Diagram object that represents the chart control’s diagram.

|

Remarks

Note that you can’t set the Diagram property manually. It’s available to be set for serialization purposes only. For more information on the chart control’s diagram see the Diagram object’s description.

Example

The following code shows how to change the XYDiagram.Rotated property value. Note that this code is valid only if the current chart’s diagram (returned by its ChartControl.Diagram or WebChartControl.Diagram property) is an XYDiagram or its descendant.

csharp
((DevExpress.XtraCharts.XYDiagram)chartControl1.Diagram).Rotated = true;
vb
CType(chartControl1.Diagram, DevExpress.XtraCharts.XYDiagram).Rotated = True

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Diagram property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-web-chart-control-create-drill-down-chart/CS/DrillDownChart/WebForm1.aspx.cs#L13

csharp
protected void Page_Load(object sender, EventArgs e) {
    XYDiagram diagram = WebChartControl1.Diagram as XYDiagram;
    if (diagram != null) {

asp-net-web-forms-web-chart-control-create-drill-down-chart/VB/DrillDownChart/WebForm1.aspx.vb#L15

vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim diagram As XYDiagram = TryCast(WebChartControl1.Diagram, XYDiagram)
    If diagram IsNot Nothing Then

See Also

WebChartControl Class

WebChartControl Members

DevExpress.XtraCharts.Web Namespace