Chart Crash on Clear.Value

Hi, in chart_SelectionChanging event i am trying to to use series.clearvalue. to deselect the older series selection because i want to select one category once not multiple. i have two series i just need select one series at a time. on windows it works fine but on android app crashes on index error. attaching the simple code.

Thanks
Aakash Solangi

Attachment: category_selection_7b0bec40.zip

1 Reply

MK Muneesh Kumar G Syncfusion Team May 21, 2018 12:32 PM UTC

Hi Aakash , 
 
Thanks for using Syncfusion products.  
 
We have analyzed your query and we have checked the given code with simple sample. It does not throw any exception while selection. But series selection misbehaves while clear SelectedDataPointIndex value in SelectionChanging. So, we request you to use SelectionChanged event instead of SelectionChanging in SfChart as follows.  
 
Code snippet [XAML]: 
<chart:SfChart SelectionChanged="chart_SelectionChanged" 
                           x:Name="chart"> 
.. 
 
 
Code snippet [C#]: 
private void chart_SelectionChanged(object sender, ChartSelectionEventArgs e) 
        { 
            if (e.SelectedSeries.Label == "Current Period") 
                chart.Series[1].ClearValue(ChartSeries.SelectedDataPointIndexProperty); 
            else 
                chart.Series[0].ClearValue(ChartSeries.SelectedDataPointIndexProperty); 
        } 
 
 
We have prepared a sample based on this, please find the sample from the following location. 
 
 
If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you. 
 
Thanks, 
Muneesh Kumar G. 
 


Loader.
Up arrow icon