com.jrefinery.chart.data
Interface PlotFitAlgorithm

All Known Implementing Classes:
LinearPlotFitAlgorithm, MovingAveragePlotFitAlgorithm

public interface PlotFitAlgorithm

an interface that any PlotFit needs to use to get the curve for the plot fit. The algorithm takes an XYDataset and comes up with a plot fit formula. Then, using this formula, it must return a y for any x supplied. The PlotFit class is responsible for querying the PlotFitAlgorithm for the data points in order to get the curve to display.

Author:
MW

Method Summary
 java.lang.String getName()
          Returns the name that you want to see in the legend.
 java.lang.Number getY(int i, java.lang.Number x)
          For a given x, must return a y.
 void setXYDataset(XYDataset ds)
          This Algorithm might or might not need an XYDataset to be relevant.
 

Method Detail

getName

public java.lang.String getName()
Returns the name that you want to see in the legend.

This is prepended to the series name that generated this plot i.e. for "Chicago Moving Average" , the name would be, "Moving Average" and "Chicago" would be the name of the series that generated the moving average.

Returns:
the name that you want to see in the legend.

setXYDataset

public void setXYDataset(XYDataset ds)
This Algorithm might or might not need an XYDataset to be relevant.
Parameters:
ds - the XYDataset for this PlotFit.

getY

public java.lang.Number getY(int i,
                             java.lang.Number x)
For a given x, must return a y.
Parameters:
x - the x value.
i - the series.
Returns:
the y value