Dynamically adding points to a Stick chart

3 posts, 1 answers
  1. Shantimohan
    Shantimohan avatar
    42 posts
    Member since:
    Jul 2012

    Posted 19 Mar 2013 Link to this post

    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. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 20 Mar 2013 Link to this post

    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.
  3. DevCraft banner
  4. Shantimohan
    Shantimohan avatar
    42 posts
    Member since:
    Jul 2012

    Posted 20 Mar 2013 Link to this post

    Yes. Using an ObservableCollection instead of List works. I should have guessed it.

    ThanQ...
Back to Top