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

Dynamically adding points to a Stick chart

2 Answers 49 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.
Shantimohan
Top achievements
Rank 1
Shantimohan asked on 19 Mar 2013, 03:48 PM
I wanted to add a OhlcModel point dynamically to a Stick chart. Unless I create a new List<OhlcModel> and set it to seriesArray.ItemSource, the chart is not displaying new points. If I just do list.Add(model), clear the chart series and add the seriesArray is not refreshing the chart.

How can I get it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 20 Mar 2013, 09:38 AM
Hi Shantimohan,

Your data source needs to implement the INotifyCollectionChanged interface. This means you can use ObservableCollection<T> instead of List<T>. This way, when you add or remove a point from your data source, the chart will know and will update itself.

All the best,
Victor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Shantimohan
Top achievements
Rank 1
answered on 20 Mar 2013, 02:38 PM
Yes. Using an ObservableCollection instead of List works. I should have guessed it.

ThanQ...
Tags
Chart
Asked by
Shantimohan
Top achievements
Rank 1
Answers by
Victor
Telerik team
Shantimohan
Top achievements
Rank 1
Share this question
or