how to use LinearPlotFitAlgorithm?

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

how to use LinearPlotFitAlgorithm?

Post by Kishore » Tue Oct 22, 2002 6:56 am

How do i use LinearPlotFitAlgorithm,which is added in the latest version 0.9.4??
i have the dataset.i.e data for x and y values. i want to show the trendLine(Linear Plot) for the data.
any he is greately appreciated..
thanks,
Kish.

Dave Gilbert

Re: how to use LinearPlotFitAlgorithm?

Post by Dave Gilbert » Tue Oct 22, 2002 8:47 am

Actually, the LinearPlotFitAlgorithm has been there for quite a while. I don't recommend using it anymore, because...

...in 0.9.4 I added the Regression class which you can use to perform linear or power regressions on a series from an XYDataset. You can plug the results of the regression into a LineFunction2D and then use the sampleFunction2D(...) method in the DatasetUtilities class to create another XYDataset containing the "fitted" trend line.

One idea I had is to make it possible to add one or more Function2D instances to the XYPlot class and have them plotted by "auto-sampling" rather than creating a fixed sample XYDataset. Perhaps this could be part of the annotations framework, or simply a list of functions attached to the plot. Anyway, it is on the to-do list...

Regards,

DG.

Locked