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

Using indicators with real time data

1 Answer 98 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Diogo
Top achievements
Rank 1
Diogo asked on 11 Dec 2015, 04:59 PM

Hi,

 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

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan
Telerik team
answered on 15 Dec 2015, 01:42 PM
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.

Regards,
Ivan
Telerik
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
Tags
ChartView
Asked by
Diogo
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or