Showing only the averaged data

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Joachim Schuler

Showing only the averaged data

Post by Joachim Schuler » Wed Jul 03, 2002 2:48 pm

Hi,

I have a TimeSeriesChart and building an moving average.

How can I only show the moving average chart in my plot. In the moment, there will be both DataSeries displayed(the primary from the XYDataset and the averaged).

I only need the averaged for my Chart.

This is a part of my code:

XYDataset xyData1 = DemoDaten.createTimeSeriesCollection(30);


MovingAveragePlotFitAlgorithm mavg = new MovingAveragePlotFitAlgorithm();
mavg.setPeriod(3);
PlotFit pf = new PlotFit(xyData1, mavg);
XYDataset xyData5 = pf.getFit();

chart = ChartFactory.createTimeSeriesChart("Time Series Chart",
"Daimler Chrysler " + runtime.getDatum() + " ",
"",
xyData5,false);

thanks for each reply

regards

Joachim

David Gilbert

Re: Showing only the averaged data

Post by David Gilbert » Thu Jul 04, 2002 6:39 am

Hi Joachim,

Unfortunately the moving average code returns a dataset containing both the original data and the moving average. I've been meaning to rewrite this class, but have not found the time yet.

One temporary solution might be to use the SubSeriesDataset, which was written as part of the combined charts implementation.

Regards,

DG.

Locked