Thanks for contacting Syncfusion Support.
You can achieve your requirement using SelectionChanged event of chart as like in the below code,
Code Snippet[XAML]:
| <chart:SfChart Header="Communication Medium" SelectionChanged="SfChart_SelectionChanged"> <chart:SfChart.Behaviors> <chart:ChartSelectionBehavior/> </chart:SfChart.Behaviors> |
Code Snippet [C#]:
| private void SfChart_SelectionChanged(object sender, ChartSelectionChangedEventArgs e) { var index = e.SelectedIndex; if (index == -1) return; ChartSegment selectedSegment = e.SelectedSegment; text.Text = index.ToString(); text1.Text = "XData: " + (selectedSegment.Item as Model).XValue.ToString() + "\n" + "YData: " + (selectedSegment.Item as Model).YValue.ToString(); } |
Please find the output screenshot below,
We have prepared a sample based on this requirement and it can be downloaded from the below link,
Regards,
Durgadevi S