com.jinsight.jetchart
Class RegressionLine

java.lang.Object
  |
  +--com.jinsight.jetchart.RegressionLine

public class RegressionLine
extends java.lang.Object

A regression line is a statistical tool used to predict future values from past values. This class calculates a linear regression line formula based on a sequence of a series values. The values of a linear regression line are calculated using a best-fit method (least squares) to place a straight line in the exact middle of a series data points. Linear regression lines are largely used in trend analysis.
Regression lines are objects held by instances of subclasses of ScatterSerie and GraphSerie, except for stacked bar series.

See Also:
GraphSerie, ScatterSerie, ScatterSerie.getRegressionLine(), GraphSerie.getRegressionLine()

Field Summary
static int DASHED
          Constant used to set the regression line style to dashed.
static int SOLID
          Constant used to set the regression line style to solid.
 
Method Summary
protected  void finalize()
           
 void setAutoInterceptEnabled(boolean isAutoInterceptEnabled)
          Enables/disables automatic calculation of the intercept value.
 void setColor(java.awt.Color color)
          Sets the color of the regression line.
 void setDashSize(int dashSize)
          Sets the size of a dash painted in a dashed regression line.
 void setDashSpace(int dashSpace)
          Sets the size of the space between consecutive dashes painted in a dashed regression line.
 void setEnabled(boolean isEnabled)
          Enables/disables the regression line.
 void setInterceptValue(double interceptValue)
          Sets the value of the intercept point.
 void setStyle(int style)
          Sets the regression line style.
 void setThickness(int thickness)
          Sets line thickness.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOLID

public static final int SOLID
Constant used to set the regression line style to solid.

DASHED

public static final int DASHED
Constant used to set the regression line style to dashed.
Method Detail

setEnabled

public void setEnabled(boolean isEnabled)
Enables/disables the regression line. Default value is false.
Parameters:
isEnabled - A boolean value(true/false).

setColor

public void setColor(java.awt.Color color)
Sets the color of the regression line.
Parameters:
color - A Color object.

setStyle

public void setStyle(int style)
Sets the regression line style. A regression line can be solid or dashed. Default style is solid.
Parameters:
style - An integer value.
See Also:
SOLID, DASHED

setDashSize

public void setDashSize(int dashSize)
Sets the size of a dash painted in a dashed regression line. Default value is 10 pixels.
Parameters:
dashSize - An integer value.
See Also:
setStyle(int), setDashSpace(int)

setDashSpace

public void setDashSpace(int dashSpace)
Sets the size of the space between consecutive dashes painted in a dashed regression line. Default value is 5 pixels.
Parameters:
dashSpace - An integer value.
See Also:
setStyle(int), setDashSize(int)

setThickness

public void setThickness(int thickness)
Sets line thickness. It is a number equal to or larger than 1. Default value is 1.
Parameters:
thickness - An integer number.

setAutoInterceptEnabled

public void setAutoInterceptEnabled(boolean isAutoInterceptEnabled)
Enables/disables automatic calculation of the intercept value. The intercept value corresponds to the point where the regression line cuts the vertical axis, in vertical charts, or the top of horizontal charts. If disabled, the intercept value has to be manually set. By default, the intercept point is automatically calculated.
Parameters:
isAutoInterceptEnabled - A boolean value(true/false).
See Also:
setInterceptValue(double)

setInterceptValue

public void setInterceptValue(double interceptValue)
Sets the value of the intercept point. Only has effect if automatic calculation of the intercept point is disabled.
Parameters:
interceptValue - A double precision number.
See Also:
setAutoInterceptEnabled(boolean)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object