Smoother XYLineChart with averaged values?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jede
Posts: 7
Joined: Fri Nov 28, 2014 4:16 pm
antibot: No, of course not.

Smoother XYLineChart with averaged values?

Post by jede » Sat Feb 11, 2017 9:16 pm

Hello,

I have the problem that my XYLineChart has some thousands of precise Double values. The rendered chart graph is not really readable, the chart goes up and down for each sample, the graph is very 'noisy'.
Does JFreeChart provide a filter or something similar which displays averaged values for each sample? E.g. each chart value could be computed as the average of the 3 values before and 3 values after.
The graph would be much better readable then.

An example of such a diagram can be seen in https://github.com/ssaring/sportstracker/issues/153 . This one looks still "ok", it's getting worse when more data is present.

Bye, Stefan

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Smoother XYLineChart with averaged values?

Post by paradoxoff » Sun Feb 12, 2017 9:02 pm

Have a look at the MovingAverage class.

Locked