Skip to main content

NestedDonutSeries2D Class

Represents a series view of the Nested Donut type.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public class NestedDonutSeries2D :
    PieSeries2D,
    ISupportSeriesGroups,
    INestedDoughnutSeriesView

Remarks

The NestedDonutSeries2D class provides the functionality of a series view of the Nested Donut type within a chart control.

In addition to the common view settings inherited from the PieSeries class, the NestedDonutSeries2D class declares the Nested Donut type specific settings. The settings allow you to define an inner indent between nested donuts (NestedDonutSeries2D.InnerIndent), specify the specific weight for each nested donut series (NestedDonutSeries2D.Weight), and create groups for similar Nested Donut series (NestedDonutSeries2D.Group).

For more information on series views of the pie type, see the Nested Donut topic.

Example

The following example demonstrates how to create a Nested Donut chart.

To do this, it is necessary to assign the ChartControl.Diagram property to SimpleDiagram2D, and then add two NestedDonutSeries2D objects with points to the diagram’s Diagram.Series collection.

Also, this example shows how to change the color of each series point according to its values using the ChartControl.CustomDrawSeriesPoint event. As a result, segments of an outer donut representing kinds of products are colored with a specific product group color (an inner donut).

Imports Microsoft.VisualBasic
Imports System.Windows
Imports DevExpress.Xpf.Charts
Imports System.Windows.Media

Namespace NestedDonutChart

    Partial Public Class MainWindow
        Inherits Window
        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub chartControl1_CustomDrawSeriesPoint(ByVal sender As Object, ByVal e As CustomDrawSeriesPointEventArgs)

            If e.SeriesPoint.Value <= 10 Then
                e.DrawOptions.Color = Color.FromArgb(&HFF, &H51, &H89, &H03)

            ElseIf (e.SeriesPoint.Value > 10) And (e.SeriesPoint.Value <= 20) Then
                e.DrawOptions.Color = Color.FromArgb(&HFF, &HF9, &HAA, &H0F)

            ElseIf e.SeriesPoint.Value > 20 Then
                e.DrawOptions.Color = Color.FromArgb(&HFF, &HC7, &H39, &H0C)
            End If
        End Sub
    End Class
End Namespace

Implements

See Also