menu

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SunburstSelectionSettings - MAUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SunburstSelectionSettings

    Represents the settings for configuring selection behavior in sunburst chart.

    Inheritance
    System.Object
    SunburstSelectionSettings
    Namespace: Syncfusion.Maui.SunburstChart
    Assembly: Syncfusion.Maui.SunburstChart.dll
    Syntax
    public class SunburstSelectionSettings : Element
    Remarks

    The SunburstSelectionSettings class provides properties to customize how segments are selected in the sunburst chart. It controls the selection behavior, visual representation of selected segments, and various highlighting options.

    This class holds properties to provide options for choosing different selection types, and customize the visual appearance of selected segments.

    Sunburst Selection Types

    Selection Types determine which segments to be selected when a user interacts with the chart. SunburstSelectionSettings offers Type property with four options.

    To configure the selection type, set the Type property to one of the SunburstSelectionType enum values:

    • Single: Only one segment can be selected at a time.
    • Group: Selects the entire hierarchical group related to the clicked segment, including its including its ancestors and descendants.
    • Parent: Selects the parent segment of the clicked segment.
    • Child: Selects all child segments of the clicked segment.
    • MainPage.xaml
    • MainPage.xaml.cs
     
    <sunburst:SfSunburstChart ItemsSource="{Binding DataSource}" ValueMemberPath="EmployeesCount">
      <sunburst:SfSunburstChart.SelectionSettings>
        <sunburst:SunburstSelectionSettings
            Type="Child"
            DisplayMode="HighlightByBrush"
            Fill="Blue" />
      </sunburst:SfSunburstChart.SelectionSettings>
    
      <sunburst:SfSunburstChart.Levels>
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="Country" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobDescription" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobRole" />
      </sunburst:SfSunburstChart.Levels>
    </sunburst:SfSunburstChart>
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    // Configure selection settings
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        Type = SunburstSelectionType.Child,
        DisplayMode = SunburstSelectionDisplayMode.HighlightByBrush,
        Fill = new SolidColorBrush(Colors.Blue)
    };
    
    // Configure other chart properties
    sunburstChart.ItemsSource = (new SunburstViewModel()).DataSource;
    sunburstChart.ValueMemberPath = "EmployeesCount";
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "Country" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobDescription" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobRole" });
    
    this.Content = sunburstChart;

    Sunburst Selection Display Modes

    Selection Display Modes determine how selected segments are visually highlighted in the chart. The SunburstSelectionSettings provides DisplayMode property with three options.

    To configure the selection display mode, set the DisplayMode property to one of the SunburstSelectionDisplayMode enum values:

    • MainPage.xaml
    • MainPage.xaml.cs
     
    <sunburst:SfSunburstChart ItemsSource="{Binding DataSource}" ValueMemberPath="EmployeesCount">
      <sunburst:SfSunburstChart.SelectionSettings>
        <sunburst:SunburstSelectionSettings
            DisplayMode="HighlightByOpacity"
            Opacity="0.6" />
      </sunburst:SfSunburstChart.SelectionSettings>
    
      <sunburst:SfSunburstChart.Levels>
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="Country" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobDescription" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobRole" />
      </sunburst:SfSunburstChart.Levels>
    </sunburst:SfSunburstChart>
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByOpacity,
        Opacity = 0.6
    };
    
    sunburstChart.ItemsSource = (new SunburstViewModel()).DataSource;
    sunburstChart.ValueMemberPath = "EmployeesCount";
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "Country" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobDescription" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobRole" });
    
    this.Content = sunburstChart;

    Selection by Brush

    When using HighlightByBrush, you can customize the color applied to selected segments using the Fill property.

    • MainPage.xaml
    • MainPage.xaml.cs
    <sunburst:SfSunburstChart ItemsSource="{Binding DataSource}" ValueMemberPath="EmployeesCount">
      <sunburst:SfSunburstChart.SelectionSettings>
        <sunburst:SunburstSelectionSettings
            Type="Group"
            DisplayMode="HighlightByBrush"
            Fill="Green" />
      </sunburst:SfSunburstChart.SelectionSettings>
    
      <sunburst:SfSunburstChart.Levels>
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="Country" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobDescription" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobRole" />
      </sunburst:SfSunburstChart.Levels>
    </sunburst:SfSunburstChart>
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        Type = SunburstSelectionType.Group,
        DisplayMode = SunburstSelectionDisplayMode.HighlightByBrush,
        Fill = new SolidColorBrush(Colors.Green)
    };
    
    sunburstChart.ItemsSource = (new SunburstViewModel()).DataSource;
    sunburstChart.ValueMemberPath = "EmployeesCount";
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "Country" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobDescription" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobRole" });
    
    this.Content = sunburstChart;

    Selection by Stroke

    When using HighlightByStroke, you can customize the stroke color and width applied to selected segments using the Stroke and StrokeWidth properties.

    • MainPage.xaml
    • MainPage.xaml.cs
    <sunburst:SfSunburstChart ItemsSource="{Binding DataSource}" ValueMemberPath="EmployeesCount">
      <sunburst:SfSunburstChart.SelectionSettings>
        <sunburst:SunburstSelectionSettings
            Type="Parent"
            DisplayMode="HighlightByStroke"
            Stroke="Purple"
            StrokeWidth="3" />
      </sunburst:SfSunburstChart.SelectionSettings>
    
      <sunburst:SfSunburstChart.Levels>
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="Country" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobDescription" />
        <sunburst:SunburstHierarchicalLevel GroupMemberPath="JobRole" />
      </sunburst:SfSunburstChart.Levels>
    </sunburst:SfSunburstChart>
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        Type = SunburstSelectionType.Parent,
        DisplayMode = SunburstSelectionDisplayMode.HighlightByStroke,
        Stroke = new SolidColorBrush(Colors.Purple),
        StrokeWidth = 3
    };
    
    sunburstChart.ItemsSource = (new SunburstViewModel()).DataSource;
    sunburstChart.ValueMemberPath = "EmployeesCount";
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "Country" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobDescription" });
    sunburstChart.Levels.Add(new SunburstHierarchicalLevel() { GroupMemberPath = "JobRole" });
    
    this.Content = sunburstChart;

    Opacity: Controls the transparency of the unselected segment's fill.

    The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). The default value is 0.7. This property is applied only to unselected segments to visually de-emphasize them. Selected segments are always rendered with full opacity (1.0).

    Fill: Brush used to fill the selected segment.

    This property defines the interior color or pattern of the selected segment. The default is a solid color brush with the color #1C1B1F.

    Stroke: Brush used for the border of the selected segment.

    This property defines the outline color or pattern of the selected segment. Like Fill, it supports various brush types. The default is a solid color brush with the color #1C1B1F.

    StrokeWidth: Thickness of the stroke around the selected segment.

    This property sets the width of the border applied to selected segments. The default value is 2.0. It is recommended to use values greater than 0 for visible borders.

    Constructors

    SunburstSelectionSettings()

    Declaration
    public SunburstSelectionSettings()

    Fields

    DisplayModeProperty

    Identifies the DisplayMode bindable property.

    Declaration
    public static readonly BindableProperty DisplayModeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    FillProperty

    Identifies the Fill bindable property.

    Declaration
    public static readonly BindableProperty FillProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    OpacityProperty

    Identifies the Opacity bindable property.

    Declaration
    public static readonly BindableProperty OpacityProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    The value should be between 0 and 1, where 0 is fully transparent and 1 is fully opaque.

    StrokeProperty

    Identifies the Stroke bindable property.

    Declaration
    public static readonly BindableProperty StrokeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    StrokeWidthProperty

    Identifies the StrokeWidth bindable property.

    Declaration
    public static readonly BindableProperty StrokeWidthProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty
    Remarks

    it is recommended to use when value is greater than 0.

    TypeProperty

    Identifies the Type bindable property.

    Declaration
    public static readonly BindableProperty TypeProperty
    Field Value
    Type
    Microsoft.Maui.Controls.BindableProperty

    Properties

    DisplayMode

    Gets or sets the visual display mode for selected segments.

    Declaration
    public SunburstSelectionDisplayMode DisplayMode { get; set; }
    Property Value
    Type Description
    SunburstSelectionDisplayMode

    The default value is HighlightByBrush.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings DisplayMode="HighlightByStroke" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByStroke,
    };

    Fill

    Gets or sets the brush to be applied to selected segments when DisplayMode is set to HighlightByBrush.

    Declaration
    public Brush Fill { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    The default value is  #1C1B1F.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings DisplayMode="HighlightByBrush" Fill="Blue" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByBrush,
        Fill = new SolidColorBrush(Colors.Blue)
    };

    Opacity

    Gets or sets the opacity value for selected segments when DisplayMode is set to HighlightByOpacity.

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

    The default value is 0.7.

    Remarks

    The value should be between 0 and 1, where 0 is fully transparent and 1 is fully opaque.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings DisplayMode="HighlightByOpacity" Opacity="0.5" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByOpacity,
        Opacity= 0.5
    };

    Stroke

    Gets or sets the brush to be applied to the stroke of selected segments when DisplayMode is set to HighlightByStroke.

    Declaration
    public Brush Stroke { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    The default value is  #1C1B1F.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings DisplayMode="HighlightByStroke" Stroke="Green" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByStroke,
        Stroke = new SolidColorBrush(Colors.Green),
    };

    StrokeWidth

    Gets or sets the stroke width for selected segments when DisplayMode is set to HighlightByStroke.

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

    The default value is 2.0.

    Remarks

    It is recommended to use it when value is greater than 0.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings DisplayMode="HighlightByStroke" StrokeWidth="3" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        DisplayMode = SunburstSelectionDisplayMode.HighlightByStroke,
        StrokeWidth = 3
    };

    Type

    Gets or sets the type of selection behavior.

    Declaration
    public SunburstSelectionType Type { get; set; }
    Property Value
    Type Description
    SunburstSelectionType

    The default value is Single.

    Examples
    <sunburst:SfSunburstChart>
        <sunburst:SfSunburstChart.SelectionSettings>
            <sunburst:SunburstSelectionSettings Type="Child" />
        </sunburst:SfSunburstChart.SelectionSettings>
    </sunburst:SfSunburstChart>
    • MainPage.xaml.cs
    SfSunburstChart sunburstChart = new SfSunburstChart();
    
    sunburstChart.SelectionSettings = new SunburstSelectionSettings
    {
        Type = SunburstSelectionType.Child,
    };
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved