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.

How to navigate to other page with data point information of selected data in chart?

Chart provides selection support for data points on touch or by using SelectedDataPointIndex property of ChartSeries to programmatically select a data pooint. You can enable the selection behavior for any series using EnableDataPointSelection property. Chart’s SelectionChanged event will notify to the user when selection changed. This event contains selected index, previous selected index and selected series. Please refer the below code snippets to enable data point selection, hooking the SelectionChanged event and navigating to another page with the selected data point information when selection changed.

 

Code snippets for enabling data point selection:

 

Xaml

 

 

C#

 

                       

Code snippets to hook SelectionChanged event:

 

Xaml

 

 

C#

 

 

Code snippet to navigate to other page with the information of selected data point:

 

C#

 

 

By default, selected segment is highlighted with a color. You can stop applying the selected segment color by cancelling the selection before navigating to other page in SelectionChanging event. Please refer the below code snippet.

 

C#

 

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
8704 04/16/2018 04/16/2018 Xamarin.Forms SfChart
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.