menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DoughnutSeries - API Reference

    Show / Hide Table of Contents

    Class DoughnutSeries

    The DoughnutSeries displays data as a proportion of the whole. Its most commonly used to make comparisons among a set of given data.

    Inheritance
    System.Object
    ChartSeries
    CircularSeries
    PieSeries
    DoughnutSeries
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PieSeries.ExplodeRadiusProperty
    PieSeries.ExplodeIndexProperty
    PieSeries.ExplodeAllProperty
    PieSeries.ExplodeOnTapProperty
    PieSeries.ExplodeRadius
    PieSeries.ExplodeIndex
    PieSeries.ExplodeAll
    PieSeries.ExplodeOnTap
    CircularSeries.StartAngleProperty
    CircularSeries.EndAngleProperty
    CircularSeries.GroupModeProperty
    CircularSeries.GroupToProperty
    CircularSeries.DataLabelSettingsProperty
    CircularSeries.RadiusProperty
    CircularSeries.YBindingPathProperty
    CircularSeries.StrokeProperty
    CircularSeries.StrokeWidthProperty
    CircularSeries.OnApplyTemplate()
    CircularSeries.DataLabelSettings
    CircularSeries.StartAngle
    CircularSeries.EndAngle
    CircularSeries.GroupMode
    CircularSeries.GroupTo
    CircularSeries.Radius
    CircularSeries.YBindingPath
    CircularSeries.StrokeWidth
    CircularSeries.Stroke
    ChartSeries.SelectionBehaviorProperty
    ChartSeries.SpacingProperty
    ChartSeries.TooltipTemplateProperty
    ChartSeries.EnableTooltipProperty
    ChartSeries.ListenPropertyChangeProperty
    ChartSeries.IsSeriesVisibleProperty
    ChartSeries.XBindingPathProperty
    ChartSeries.ItemsSourceProperty
    ChartSeries.TrackballLabelTemplateProperty
    ChartSeries.FillProperty
    ChartSeries.LabelProperty
    ChartSeries.LegendIconProperty
    ChartSeries.LegendIconTemplateProperty
    ChartSeries.IsVisibleOnLegendProperty
    ChartSeries.EnableAnimationProperty
    ChartSeries.AnimationDurationProperty
    ChartSeries.PaletteBrushesProperty
    ChartSeries.ShowDataLabelsProperty
    ChartSeries.SuspendNotification()
    ChartSeries.ResumeNotification()
    ChartSeries.OnPointerPressed(PointerRoutedEventArgs)
    ChartSeries.OnPointerMoved(PointerRoutedEventArgs)
    ChartSeries.OnTapped(TappedRoutedEventArgs)
    ChartSeries.OnPointerExited(PointerRoutedEventArgs)
    ChartSeries.OnPointerReleased(PointerRoutedEventArgs)
    ChartSeries.SelectionBehavior
    ChartSeries.PaletteBrushes
    ChartSeries.TooltipTemplate
    ChartSeries.EnableTooltip
    ChartSeries.ListenPropertyChange
    ChartSeries.IsSeriesVisible
    ChartSeries.ItemsSource
    ChartSeries.TrackballLabelTemplate
    ChartSeries.Fill
    ChartSeries.Label
    ChartSeries.LegendIcon
    ChartSeries.LegendIconTemplate
    ChartSeries.IsVisibleOnLegend
    ChartSeries.XBindingPath
    ChartSeries.EnableAnimation
    ChartSeries.AnimationDuration
    ChartSeries.Chart
    ChartSeries.ShowDataLabels
    ChartSeries.PropertyChanged
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.Chart.WinUI.dll
    Syntax
    public class DoughnutSeries : PieSeries, INotifyPropertyChanged
    Remarks

    It is similar to the PieSeries. To render a series, create an instance of the doughnut series class, and add it to the Series collection.

    It Provides options for PaletteBrushes, Fill, Stroke, StrokeWidth, and InnerRadius to customize the appearance.

    EnableTooltip - The tooltip displays information while tapping or mouse hovering on the segment. To display the tooltip on the chart, you need to set the EnableTooltip property as true in DoughnutSeries and refer to the TooltipBehavior property.

    Data Label - Data labels are used to display values related to a chart segment. To render the data labels, you need to set the property as true in the DoughnutSeries class. To customize the chart data labels’ alignment, placement, and label styles, you need to create an instance of CircularDataLabelSettings and set it to the DataLabelSettings property.

    Animation - To animate the series, set True to the EnableAnimation property.

    Selection - To enable the data point selection in the series, create an instance of the DataPointSelectionBehavior and set it to the property of the doughnut series. To highlight the selected segment, set the value for the SelectionBrush property in the DataPointSelectionBehavior class.

    LegendIcon - To customize the legend icon using the LegendIcon, and LegendIconTemplate property.

    Examples
    • Xaml
    • C#
    • ViewModel
        <chart:SfCircularChart>
    
            <chart:DoughnutSeries ItemsSource="{Binding Data}"
                                  XBindingPath="XValue"
                                  YBindingPath="YValue"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
    
        ViewModel viewModel = new ViewModel();
    
        DoughnutSeries series = new DoughnutSeries();
        series.ItemsSource = viewModel.Data;
        series.XBindingPath = "XValue";
        series.YBindingPath = "YValue";
        chart.Series.Add(series);
        public ObservableCollection<Model> Data { get; set; }
    
        public ViewModel()
        {
           Data = new ObservableCollection<Model>();
           Data.Add(new Model() { XValue = 10, YValue = 100 });
           Data.Add(new Model() { XValue = 20, YValue = 150 });
           Data.Add(new Model() { XValue = 30, YValue = 110 });
           Data.Add(new Model() { XValue = 40, YValue = 230 });
        }

    Constructors

    DoughnutSeries()

    Initializes a new instance of the DoughnutSeries class.

    Declaration
    public DoughnutSeries()

    Fields

    InnerRadiusProperty

    The DependencyProperty for InnerRadius property

    Declaration
    public static readonly DependencyProperty InnerRadiusProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    Properties

    InnerRadius

    Gets or sets a value that can be used to define the inner circle.

    Declaration
    public double InnerRadius { get; set; }
    Property Value
    Type Description
    System.Double

    It accepts double values, and the default value is 0.4. Here, the value is between 0 and 1.

    Examples
    • Xaml
    • C#
        <chart:SfCircularChart>
    
             <chart:DoughnutSeries ItemsSource="{Binding Data}"
                                   XBindingPath="XValue"
                                   YBindingPath="YValue"
                                   InnerRadius = "0.5"/>
    
        </chart:SfCircularChart>
        SfCircularChart chart = new SfCircularChart();
        ViewModel viewModel = new ViewModel();
    
        DoughnutSeries series = new DoughnutSeries()
        {
              ItemsSource = viewModel.Data,
              XBindingPath = "XValue",
              YBindingPath = "YValue",
              InnerRadius = 0.5,
        };
    
        chart.Series.Add(series);

    Segment

    Declaration
    public DoughnutSegment Segment { get; }
    Property Value
    Type Description
    DoughnutSegment

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PieSegment
    PieSeries
    DoughnutSegment
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved