com.jrefinery.chart.data
Class LinearPlotFitAlgorithm

java.lang.Object
  |
  +--com.jrefinery.chart.data.LinearPlotFitAlgorithm
All Implemented Interfaces:
PlotFitAlgorithm

public class LinearPlotFitAlgorithm
extends java.lang.Object
implements PlotFitAlgorithm

A linear plot fit algorithm contributed by Matthew Wright.

Author:
MW

Constructor Summary
LinearPlotFitAlgorithm()
           
 
Method Summary
 java.lang.String getName()
          Returns the name that you want to see in the legend.
 java.lang.Number getY(int series, java.lang.Number x)
          Returns a y-value for any given x-value.
 void setXYDataset(XYDataset data)
          Sets the dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearPlotFitAlgorithm

public LinearPlotFitAlgorithm()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: PlotFitAlgorithm
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.

Specified by:
getName in interface PlotFitAlgorithm
Returns:
the name that you want to see in the legend.

setXYDataset

public void setXYDataset(XYDataset data)
Sets the dataset.
Specified by:
setXYDataset in interface PlotFitAlgorithm
Parameters:
data - the dataset.

getY

public java.lang.Number getY(int series,
                             java.lang.Number x)
Returns a y-value for any given x-value.
Specified by:
getY in interface PlotFitAlgorithm
Parameters:
x - the x value.
series - the series.
Returns:
the y value.