Back to Devexpress

XRChart.Diagram Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrchart-d4abcf69.md

latest6.6 KB
Original Source

XRChart.Diagram Property

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

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[SRCategory(ReportStringId.CatElements)]
public Diagram Diagram { get; set; }
vb
<SRCategory(ReportStringId.CatElements)>
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 topic and the Diagram object ‘s description.

The following code snippets (auto-collected from DevExpress Examples) contain references 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.

dashboard-constant-lines/CS/ConstantLineExtension.Win/ConstantLineModule.cs#L58

csharp
if (chartControl != null && chartItem != null) {
    AddConstantLinesToDiagram(chartControl.Diagram as XYDiagram, chartItem);
}

winforms-dashboard-custom-properties/CS/WinForms-Dashboard-Custom-Properties/Modules/ChartScaleBreakModule.cs#L64

csharp
string itemComponentName = control.Key;
    UpdateChartScaleBreaks(designer.Dashboard.Items[itemComponentName], xrChart.Diagram);
}

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/CS/MultiPaneExtension/MultiPaneModule.cs#L88

csharp
MultiPaneSettings settings = MultiPaneSettings.FromJson(chartItem.CustomProperties[customPropertyName]);
    CustomizeDiagram(xrChart.Diagram as XYDiagram, xrChart.Series, settings);
}

asp-net-web-forms-dashboard-custom-properties-sample/CS/WebFormsDashboardCustomPropertiesSample/Export/ChartConstantLinesExtension.cs#L33

csharp
if(constantLinesJSON != null) {
    XYDiagram diagram = chartControl.Diagram as XYDiagram;
    if(diagram != null) {

asp-net-mvc-dashboard-custom-properties-sample/CS/AspMvcDashboardCustomPropertiesSample/Export/ChartConstantLinesExtension.cs#L33

csharp
if(constantLinesJSON != null) {
    XYDiagram diagram = chartControl.Diagram as XYDiagram;
    if(diagram != null) {

winforms-dashboard-custom-properties/VB/WinForms-Dashboard-Custom-Properties/Modules/ChartScaleBreakModule.vb#L66

vb
Dim itemComponentName As String = control.Key
    UpdateChartScaleBreaks(designer.Dashboard.Items(itemComponentName), xrChart.Diagram)
End If

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/VB/MultiPaneExtension/MultiPaneModule.vb#L86

vb
Dim settings As MultiPaneSettings = MultiPaneSettings.FromJson(chartItem.CustomProperties(customPropertyName))
    CustomizeDiagram(TryCast(xrChart.Diagram, XYDiagram), xrChart.Series, settings)
End If

asp-net-web-forms-dashboard-custom-properties-sample/VB/WebFormsDashboardCustomPropertiesSample/Export/ChartConstantLinesExtension.vb#L32

vb
If constantLinesJSON IsNot Nothing Then
    Dim diagram As XYDiagram = TryCast(chartControl.Diagram, XYDiagram)
    If diagram IsNot Nothing Then

wpf-dashboard-custom-properties/VB/Wpf-Dashboard-Custom-Properties/Modules/ChartItemModule/ChartOptions/ScaleBreak.vb#L33

vb
Dim xrChart As XRChart = TryCast(control.Value, XRChart)
If xrChart IsNot Nothing AndAlso xrChart.Diagram IsNot Nothing Then
    Dim chartItem As DashboardItem = dashboardControl.Dashboard.Items(control.Key)

See Also

XRChart Class

XRChart Members

DevExpress.XtraReports.UI Namespace