Real-time chart with dynamic collection of Lineseries

2 posts, 1 answers
  1. Lavanya
    Lavanya avatar
    1 posts
    Member since:
    Aug 2014

    Posted 02 Nov 2014 Link to this post


    I am working on a project where I need two things to be satisfied:
    1. The chart has to be plotted for real-time data where each series on the chart must be smoothly plotted without any synchronization issue.
    2. The Observablecollection that contains the list of series to be plotted (which is used to set as datacontext) has to be dynamic, i.e., it must be possible to add/remove the series dynamically.

    I'm able to achieve the above features separately but not together, i.e., On adding a new Series dynamically, the chart doesn't show continuous data plot for all the series, even after using Task/Dispatcher. Any suggestion on how should I proceed on this?
    Thank you in advance.
  2. Answer
    Petar Marchev
    Petar Marchev avatar
    996 posts

    Posted 05 Nov 2014 Link to this post

    Hello Lavanya,

    I suspect you are talking about the new ChartView and not the old RadChart control.

    I am a little unsure about how you have achieved these features individually, and there is a chance that my proposal will differ from your current implementation. I am attaching a project demonstrating one possible way to get this going.

    In it, I have used a SeriesProvider to get the dynamic number of series part working (point 2.). Each series-model has its own timer and updates its data async (point 1.). Note that the update has to be on the main thread.

    These two features do not interact with each other (they do not rely on each other, do not contradict and do not complement each other). This is why implementing them together is relatively easy. Let us know if you have any other questions.

    Petar Marchev

    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.

Back to Top