-
Notifications
You must be signed in to change notification settings - Fork 25
973016-UG Document for .NET MAUI Sunburst Selection support #3523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Saravanan-Madhesh
merged 8 commits into
development
from
UG-Document-for-.NET-MAUI-Sunburst-Selection-support
Aug 19, 2025
+275
−0
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
696ed6c
commit
EzhilarasanElangovan31 bf2b20b
commit
EzhilarasanElangovan31 699773c
Updated YT link
EzhilarasanElangovan31 058a32f
commit
EzhilarasanElangovan31 d7404c0
Commit
EzhilarasanElangovan31 e302878
Commit
EzhilarasanElangovan31 fb0439e
Commit
EzhilarasanElangovan31 ca6373f
Update Selection.md
VimalaThirumalaikumar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,274 @@ | ||
--- | ||
layout: post | ||
title: Selection in .NET MAUI Sunburst Chart control | Syncfusion | ||
description: This section explains how to enable and customize selection in the Syncfusion<sup>®</sup> .NET MAUI Sunburst Chart control. | ||
platform: maui | ||
control: SfSunburstChart | ||
documentation: ug | ||
--- | ||
# Selection in .NET MAUI Sunburst Chart | ||
|
||
The Sunburst Chart supports segment selection and highlighting. Selection is triggered by a tap gesture on a segment, allowing users to interact with hierarchical data. | ||
|
||
## Type | ||
|
||
The `Type` property allows you to select a segment based on the following categories: | ||
* Child: Highlights the selected segment along with its children in all levels. | ||
* Group: Highlights the entire group of the selected segment in a hierarchy. | ||
* Parent: Highlights the parent of the selected segment in the hierarchy. | ||
* Single: Highlights the selected segment alone. | ||
|
||
The default value of the `Type` property is `Single`. | ||
|
||
The following code shows the `Child` selection type. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Type="Child"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Type = SunburstSelectionType.Child | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
The following code shows the `Group` selection type. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Type="Group"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Type = SunburstSelectionType.Group | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
The following code shows the `Parent` selection type. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Type="Parent"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Type = SunburstSelectionType.Parent | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
The following code shows the `Single` selection type. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Type="Single"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Type = SunburstSelectionType.Single | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
## DisplayMode | ||
|
||
The `DisplayMode` property provides the following selection options to highlight the segments: | ||
EzhilarasanElangovan31 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* By Brush | ||
* By opacity | ||
* By stroke | ||
|
||
The default value of `DisplayMode` is `HighlightByBrush`. | ||
|
||
### Brush | ||
|
||
This mode highlights the selected segment using the brush defined in the `Fill` property of the `SunburstSelectionSettings`. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Fill="Pink" DisplayMode="HighlightByBrush" Type="Child"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Fill = Colors.Pink, | ||
DisplayMode = SunburstSelectionDisplayMode.HighlightByBrush, | ||
Type = SunburstSelectionType.Child, | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
### Opacity | ||
|
||
This mode highlights the selected segment with full opacity as 1, while unselected segments use the opacity value defined in the `Opacity` property. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Opacity="0.6" DisplayMode="HighlightByOpacity" Type="Child"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Opacity = 0.6, | ||
DisplayMode = SunburstSelectionDisplayMode.HighlightByOpacity, | ||
Type = SunburstSelectionType.Child, | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
### Stoke | ||
|
||
This mode highlights the selected segment by applying stroke to it. The color and thickness of the stroke can be customized using the `Stroke` and `StrokeWidth` properties. | ||
|
||
{% tabs %} | ||
|
||
{% highlight xaml %} | ||
|
||
<chart:SfSunburstChart> | ||
. . . | ||
<chart:SfSunburstChart.SelectionSettings> | ||
<chart:SunburstSelectionSettings Stroke="Black" StrokeWidth="3" DisplayMode="HighlightByStroke" Type="Child"/> | ||
</chart:SfSunburstChart.SelectionSettings> | ||
</chart:SfSunburstChart> | ||
|
||
{% endhighlight %} | ||
|
||
{% highlight c# %} | ||
|
||
SfSunburstChart sunburstChart = new SfSunburstChart(); | ||
. . . | ||
SunburstSelectionSettings selectionSettings = new SunburstSelectionSettings | ||
{ | ||
Stroke = Colors.Black, | ||
StrokeWidth = 3, | ||
DisplayMode = SunburstSelectionDisplayMode.HighlightByStroke, | ||
Type = SunburstSelectionType.Child, | ||
}; | ||
sunburstChart.SelectionSettings = selectionSettings; | ||
this.Content = sunburst; | ||
|
||
{% endhighlight %} | ||
|
||
{% endtabs %} | ||
|
||
## Events | ||
|
||
### SelectionChanging | ||
|
||
The `SelectionChanging` occurs when a segment in the Sunburst chart is being selected. | ||
This is a cancelable event. The following properties are contained in the event arguments: | ||
|
||
* `NewSegment`: Gets the new segment that was selected. | ||
* `OldSegment`: Gets the old segment that was selected or deselected. | ||
* `Cancel` - Gets or sets the value whether to continue selection or not. | ||
|
||
|
||
### Selection Changed | ||
|
||
The `SelectionChanged` event occurs when a segment in the Sunburst chart is selected or deselected. The following properties are contained in the event arguments: | ||
|
||
* `IsSelected`: Indicates whether a segment is selected. | ||
* `NewSegment`: Gets the new segment that was selected. | ||
* `OldSegment`: Gets the old segment that was selected or deselected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.