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.
Syncfusion Feedback

On Pie Chart Click Event

Thread ID:

Created:

Updated:

Platform:

Replies:

132309 Aug 25,2017 09:34 AM UTC Aug 28,2017 10:20 AM UTC Xamarin.Forms 1
loading
Tags: SfChart
Aman
Asked On August 25, 2017 09:34 AM UTC

I have used synfusion library in xamarin forms to create a doughnut chart. Now, I want to open another page on clicking any of the slices in a doughnut. The attribute explode_all_on_touch just explodes the slices. But , I want to open a different page on clicking any of the slices. How can I achieve this?? Please help me out.

Parthiban Sundaram [Syncfusion]
Replied On August 28, 2017 10:20 AM UTC

Hi Aman,

Thanks for using Syncfusion Products.

We have achieved your requirement using SelectionChanging event in SfChart to navigate the different page. Please find the below code snippet for more details.

Code Snippet:
 
   
XAML Code:  
   
  <chart:SfChart SelectionChanging="Chart_SelectionChanging">  
...  
<chart:DoughnutSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue" EnableDataPointSelection="true">  
  </chart:DoughnutSeries>  
...  
</chart:SfChart>  
   
C#:  
   
        privatevoid Chart_SelectionChanging(object sender, ChartSelectionChangingEventArgs e)  
        {  
             e.Cancel = true// Disables the datapoint selection  
            Navigation.PushModalAsync(newNewPage());  
        }  
   
 


Sample: http://www.syncfusion.com/downloads/support/forum/132309/ze/DoughnutSample-102519379  

Please refer the below UG link for enabling or disabling the data point selection.

https://help.syncfusion.com/xamarin/sfchart/selection  

Please let us know, if you need further assistance on this.

Regards,
Parthiban S
 
 


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.

Warning Icon 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.Close Icon

;