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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

129035 Feb 22,2017 11:40 AM Feb 26,2017 10:53 AM Xamarin.Forms 3
loading
Tags: SfChart
Sudhansu
Asked On February 22, 2017 11:40 AM

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.

Saravana Pandian Murugan [Syncfusion]
Replied On February 23, 2017 11:20 AM

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  

Regards,
Saravana Pandian M. 


Sudhansu
Replied On February 24, 2017 04:42 PM

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.

Prabakaran
Replied On February 26, 2017 10:53 AM

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

C#
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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;