This is a migrated thread and some comments may be shown as answers.

Chart not updating with new data

2 Answers 82 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Niall
Top achievements
Rank 1
Niall asked on 15 Aug 2014, 10:23 PM
Hi,

I'm using the Universal RadCartesianChart with ScatterSplineAreaSeries in a WP8.1 app + can't seem to update the ItemsSource once it's already been shown (works great the first time I set the data). My scenario is that a various events on the page (ie. flipview change) will mean a new set of points need to get rendered in the chart.

I've tried a multitude of techniques to get this working with no success (things also I see suggested for this control on other platforms) - it simply won't re-render the chart with new set of Data/Points I provided :

For example :

1) Used ObservableCollection<> for the data.
2) Raised INotifyPropertyChanged events on class hosting this Collection.
3) Tried directly clearing the ScatterSplineAreaSeries.ItemsSource to null + setting with new data.
4) Tried (3) but then tried setting with new data on new thread using Core.Dispatcher.
5) Tried calling various Update/Invalidate methods on the chart.

None of these seem to work at all.

I'm assuming if I instantiate a completely new instance of the entire control each time I want to change data that will likely work - but it's not a very efficient way to go (I want to it to be smooth/glitch free and not waste unneeded memory/cpu etc).

Any suggestions - or is this a bug which needs an updated version?

thanks

Niall

2 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 20 Aug 2014, 01:26 PM
Hi Niall,

Thank you for the question.

I have attached a sample project with a chart control where the data binding works as expected in different scenarios:
  • Change a property of the model class
  • Add new data to the items source collection
  • Set a new items source collection 
Could you please take a look at the project and modify it in order to reproduce the erroneous behavior.

I look forward to your reply.

Regards,
Rosy Topchiyska
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Patrick
Top achievements
Rank 1
answered on 03 Dec 2014, 07:16 AM
I have a similar behaviour but not reproducable. It occurs only sometimes!?
Tags
Chart
Asked by
Niall
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or