Using indicators with real time data

2 posts, 1 answers
  1. Diogo
    Diogo avatar
    1 posts
    Member since:
    Sep 2015

    Posted 11 Dec 2015 Link to this post


     I'm trying to build chart with real time data, where I display some values with a StepLineSeries, and this works fine. However, I want to display the Moving Average of those values as well, and for that I'm using the MovingAverageIndicator but it doesn't work. 

     If I display all the data at once the MovingAverageIndicator works just fine but, if I try to display it with the data being added in real time it doesn't work. Is this some limitation of the indicator or am I doing something wrong?

     Best regards,

    Diogo Duarte

  2. Answer
    Ivan avatar
    44 posts

    Posted 15 Dec 2015 Link to this post

    Hi Diogo,

    It seems that the live data scenario is not handled by the chart's MovingAverageIndicator. I logged an item related to this behavior in our feedback portal. I also updated your Telerik points. 

    To update the data points of the indicator you can reset its Period property when a new item is added in the ItemsSource. For example:
    // add new item
    var indicator = chart.Indicators[0] as MovingAverageIndicator;
    var period = indicator.Period;
    indicator.Period = 0;
    indicator.Period = period;

    I hope this helps.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top