We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfChart for Pie Series - Possibility to have event on Pie chart colored portion to deep drive to display list.

Need help with sample code where it shows how to have the event to click on colored part of pie chart to navigate to a new page to display the items for those colored part.
So every colored part should navigate to show respective items included in that part of pie chart.

3 Replies

SP Saravana Pandian Murugan Syncfusion Team February 23, 2017 04:20 PM UTC

Hi Sudhansu,

Thanks for contacting Syncfusion support.

We have prepared a sample based on your requirement which can be downloaded from the below location. We have achieved your requirement using ChartSelectionChanged Event.

Sample : http://www.syncfusion.com/downloads/support/forum/129035/ze/Doughnut-1073410953  

Saravana Pandian M. 

SU Sudhansu February 24, 2017 09:42 PM UTC

Thanks that is working, but how can we unselect the pie once we return to chart page.
Need to know to be able to cancel the selection or set default selection as null.

PR Prabakaran February 26, 2017 03:53 PM UTC

We can cancel the selection using Chart.SelectionChanging event. Here is the code for your reference,

chart.SelectionChanging += (sender, e) =>
e.Cancel = true;
Navigation.PushAsync(new ContentPage()
Content = new Label()
FontSize = 20,
TextColor = Color.Purple,
VerticalOptions = LayoutOptions.Center,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Text = "You have Selected an index No: " + e.SelectedDataPointIndex,
}, false);

Attachment: Doughnut_43cd89fa.zip

Live Chat Icon For mobile
Up arrow icon