moving average not displaying?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hjf
Posts: 5
Joined: Wed Jul 26, 2006 7:27 pm

moving average not displaying?

Post by hjf » Wed Jul 26, 2006 7:32 pm

Hi everyone.
I have a graph that shows the temperatures of a sensor located outside my house. It sends the temperature at regular intervals, so I have a TimeSeries and a TimeSeriesCollection.

Every second it does this:

Code: Select all

chartdataset.add(actual, temperatura);
so the new temperature is loaded an the graph is automagically updated. The problem is that I tried to add a moving average. But that is not showing. The legend says " -- Moving average" (in a different color), but it doesn't actually draw the line.

Every time I add a new temperature I also do this:

Code: Select all

tmpMovingAverage.add(actual, temperatura);
I even made

Code: Select all

temperatura=Math.random()*100;
so the data will have a big span, but even then the blue line doesnt show.

What am I doing wrong?

Cheers!
hjf.

hjf
Posts: 5
Joined: Wed Jul 26, 2006 7:27 pm

Post by hjf » Sat Jul 29, 2006 12:54 am

Well I checked with some random data, and the line is showing, just not updating. (I loaded it with data, the first few points show, but new data is not shown).

Anyone?

Locked