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. Image for the cookie policy date

Cant get Box and Whisker chart to update on changing data set

Hey there,
at first, thank you for your awesome controls! I was able to solve every problem until now. Following problem occurs:
A set of data is displayed in the box and whisker chart control, so far so good. But I want to change this set of data, so I'm clearing my ObservableCollection after selecting an item in a ListView, afterwards it gets filled with new data  Other controls of yours are updating just fine doing it this way, but not this control. Right now it displays only the first set of data, ignoring the update of the Collection. Can you tell me what I'm missing?

best regards,
Axel

3 Replies

DS Durgadevi Selvaraj Syncfusion Team May 29, 2017 08:58 AM UTC

Hi Axel, 
Thanks for contacting Syncfusion Support.

We would like to inform you that, we can achieve your requirement(Clearing and adding data dynamically for box and whisker series) by clearing and reset the items source for box and whisker series as shown in below code.  
private void ClearAndAddDatas(object sender, RoutedEventArgs e) 
{     
  viewmodel.Collection.Clear(); 
    viewmodel.Collection.Add(new Model() { XValue = "Jul", YValue = new List<double> { 21, 23, 24, 25, 26, 27, 28, 30, 34, 36, 38 } }); 
    viewmodel.Collection.Add(new Model() { XValue = "Aug", YValue = new List<double> { 26, 28, 29, 30, 32, 33, 35, 36, 52 } }); 
    viewmodel.Collection.Add(new Model() { XValue = "Sep", YValue = new List<double> { 28, 29, 30, 31, 32, 34, 35, 36 } }); 
    viewmodel.Collection.Add(new Model() { XValue = "Oct", YValue = new List<double> { 27, 26, 28, 29, 29, 29, 32, 35, 32, 38, 53 } }); 
    viewmodel.Collection.Add(new Model() { XValue = "Nov", YValue = new List<double> { 25, 30, 45, 50, 52, 32, 60 } }); 
    viewmodel.Collection.Add(new Model() { XValue = "Dec", YValue = new List<double> { 26, 27, 28, 30, 32, 34, 35, 37, 35, 37, 45 } }); 
    chart.Series[0].ItemsSource = viewmodel.Collection; 
} 
 

Please find the output screentshot,

1. Initial loading of box and whisker chart,

2.After clearing and adding of new set of datas,
 
We have prepared the sample based on this and you can downloaded it from the below link,

Sample: Box&Whisker_Sample


Regards,
Durgadevi S 
  
  



AD Axel Dünninger June 12, 2017 04:37 PM UTC

Hey Durgadevi,

sorry for my really late response. I was able to update my plot, so... thank you!



kind regards
Axel


DS Durgadevi Selvaraj Syncfusion Team June 13, 2017 08:52 AM UTC

Hi Axel,

Thanks for your update.

Please let us know if you need any further assistance.

Regards,
Durgadevi.


Loader.
Live Chat Icon For mobile
Up arrow icon