EspressReport 6.6

quadbase.util
Interface ITrendLine

All Superinterfaces:
java.lang.Cloneable, IDataLine, IReferenceObj

public interface ITrendLine
extends IDataLine


Field Summary
static int BSPLINE
           
static int EXPONENTIAL
           
static int EXPONENTIAL_AVERAGE
           
static int HORIZONTAL_LINE
           
static int LOGARITHMIC
           
static int NORMAL_CURVE
           
static int POLYNOMIAL
           
static int POWER
           
static int SIMPLE_AVERAGE
           
static int TRIANGULAR_AVERAGE
           
static int VERTICAL_LINE
           
 
Fields inherited from interface quadbase.util.IDataLine
CLOSE, DASH_STYLE, DOTTED_STYLE, HIGH, LOW, OPEN, SOLID_STYLE
 
Method Summary
 void drawStandardDevLine(java.awt.Color color, double mDev, java.lang.String label)
          Draw lines at multiples of deviation value for a NORMAL curve only works for Histogram charts with setLinearScale & setRounded to true.
 int getCoeff()
          Get the degree for POLYNOMIAL or period for SIMPLE_AVERAGE, TRIANGULAR_AVERAGE and EXPONENTIAL_AVERAGE.
 double[] getInterpolateCoeffs()
          The function returns the interpolated constant values for Polynomial, Exponential, Logarithmic, and Power.
 double getInverseNorm(double prob)
          Get the INVERSE NORMAL value by specifying the probability of a NORMAL distribution curve.
 int getLineType()
          Get the line type
 double getLineValue()
          Get the line value used by horizontal/vertical line type
 double getMax()
          Get the maximum value for a NORMAL curve
 double getMean()
          Get the mean value for a NORMAL curve
 double getMin()
          Get the minimum value for a NORMAL curve
 double getProbability(double mDev)
          Get the probability to the left by specifying multiple of deviation of a NORMAL distribution curve.
 boolean getStackChartLine()
          Get the stack direction that this trend line used.
 double getStandardDev()
          Get the standard deviation value for a NORMAL curve
 void setCoeff(int coeff)
          Set the degree (for POLYNOMIAL) or period (for SIMPLE_AVERAGE, TRIANGULAR_AVERAGE and EXPONENTIAL_AVERAGE).
If you want to change line type also you should call setLineType() first, followed by setCoeff().
 void setLineType(int lineType)
          Sets the line type.
 void setLineValue(double line_value)
          Set the value for the horizontal line or vertical line.
 void setStackChartLine(boolean positive)
          This is used for stack column chart and stack area chart only.
 
Methods inherited from interface quadbase.util.IDataLine
getColor, getLineStyle, getSeries, getShowHintValue, getThickness, getTitle, getValueColumn, getValueHint, isSecondaryValueUsed, isTitleVisibleInLegend, setColor, setLineStyle, setSeries, setShowHintValue, setThickness, setTitle, setTitleVisibleInLegend, setValueColumn, setValueHint, useSecondaryValue
 
Methods inherited from interface quadbase.util.IReferenceObj
addAnnotation, getAnnotations, getReferencePosition, isVisible, removeAnnotation
 

Field Detail

POLYNOMIAL

static final int POLYNOMIAL
See Also:
Constant Field Values

EXPONENTIAL

static final int EXPONENTIAL
See Also:
Constant Field Values

LOGARITHMIC

static final int LOGARITHMIC
See Also:
Constant Field Values

POWER

static final int POWER
See Also:
Constant Field Values

SIMPLE_AVERAGE

static final int SIMPLE_AVERAGE
See Also:
Constant Field Values

EXPONENTIAL_AVERAGE

static final int EXPONENTIAL_AVERAGE
See Also:
Constant Field Values

TRIANGULAR_AVERAGE

static final int TRIANGULAR_AVERAGE
See Also:
Constant Field Values

HORIZONTAL_LINE

static final int HORIZONTAL_LINE
See Also:
Constant Field Values

VERTICAL_LINE

static final int VERTICAL_LINE
See Also:
Constant Field Values

BSPLINE

static final int BSPLINE
See Also:
Constant Field Values

NORMAL_CURVE

static final int NORMAL_CURVE
See Also:
Constant Field Values
Method Detail

setCoeff

void setCoeff(int coeff)
Set the degree (for POLYNOMIAL) or period (for SIMPLE_AVERAGE, TRIANGULAR_AVERAGE and EXPONENTIAL_AVERAGE).
If you want to change line type also you should call setLineType() first, followed by setCoeff(). Otherwise the coefficient will be reset by setLineType() if setCoeff() is called first.

Specified by:
setCoeff in interface IDataLine
Parameters:
coeff - fitting degree or period of moving average

getCoeff

int getCoeff()
Get the degree for POLYNOMIAL or period for SIMPLE_AVERAGE, TRIANGULAR_AVERAGE and EXPONENTIAL_AVERAGE. For other types, it returns 1.

Specified by:
getCoeff in interface IDataLine
Returns:
degree/period

setLineType

void setLineType(int lineType)
Sets the line type. The default type is POLYNOMIAL.

Specified by:
setLineType in interface IDataLine
Parameters:
lineType - the type of this trend line.

getLineType

int getLineType()
Get the line type

Specified by:
getLineType in interface IDataLine
Returns:
line type

setLineValue

void setLineValue(double line_value)
Set the value for the horizontal line or vertical line. For horizontal line if the Y-axis is of numeric value then the line is drawn using line_value, otherwise (i.e. Y-axis contains category name as in bar chart) the value is interpreted as :
1 - draw a line between 1st and 2nd category
2 - draw a line between 2nd and 3rd category
etc...
Similarily, line_value = 1.5 will draw a line on the 2nd category.

For vertical line if the X-axis is of numeric value then the line is drawn using line_value, otherwise the value is interpreted as above.

Specified by:
setLineValue in interface IDataLine
See Also:
IHorzVertLine

getLineValue

double getLineValue()
Get the line value used by horizontal/vertical line type

Specified by:
getLineValue in interface IDataLine
See Also:
IHorzVertLine

setStackChartLine

void setStackChartLine(boolean positive)
This is used for stack column chart and stack area chart only. Set the stack direction - positive or negative, used to draw the trend line. Positive means the trend line will use the sum of value in the positive direction to draw the trend line. Notice that for stack chart, positive and negative values are stacked in different direction. Default is positive.

Parameters:
positive - true if positive direction is used

getStackChartLine

boolean getStackChartLine()
Get the stack direction that this trend line used.

Returns:
true if positive direction

getInterpolateCoeffs

double[] getInterpolateCoeffs()
The function returns the interpolated constant values for Polynomial, Exponential, Logarithmic, and Power.

For non-scatter chart, the x value used for interpolation is 1, 2,.... m where m is the no. of category.
For scatter chart, x is the real value used for plotting.

For polynomial of degree N, the return array c[] have N+1 values where y = c[0] + c[1]*x + c[2]*x^2 + ....
For exponential, logarithmic, and power, the return array is of size 2
y' = c[0] + c[1]*x'
where x' , y' is the transform value.
For logarithmic : x' = log(x), y'=y;
For exponential : x' = x, y' = log(y);
For power : x' = log(x), y' = log(y);

This return value is valid only after the chart is actually draw. For other chart types, it returns null;


getMean

double getMean()
Get the mean value for a NORMAL curve

Returns:
mean value

getStandardDev

double getStandardDev()
Get the standard deviation value for a NORMAL curve

Returns:
standard deviation value

drawStandardDevLine

void drawStandardDevLine(java.awt.Color color,
                         double mDev,
                         java.lang.String label)
Draw lines at multiples of deviation value for a NORMAL curve only works for Histogram charts with setLinearScale & setRounded to true. You would want the data sorted in the ascending order for the Histogram to make sense as well. To draw the line for mean, set the mDev value to 0.0.

Parameters:
color - color of the standard deviation line
mDev - line to be drawn at multiples of deviation value
label - label of the line drawn

getMin

double getMin()
Get the minimum value for a NORMAL curve

Returns:
minimum value

getMax

double getMax()
Get the maximum value for a NORMAL curve

Returns:
maximum value

getProbability

double getProbability(double mDev)
Get the probability to the left by specifying multiple of deviation of a NORMAL distribution curve. Normal distribution curve has been standardized to have a mean value of 0.0, and standard deviation of 1.0.

Returns:
probability, range of 0.0 to 1.0. Maximum error of approx. 1.0X10E-9.

getInverseNorm

double getInverseNorm(double prob)
Get the INVERSE NORMAL value by specifying the probability of a NORMAL distribution curve. Normal distribution curve has been standardized to have a mean value of 0.0, and standard deviation of 1.0. Valid input range of probability is 0.0 to 1.0, exclusive.

Returns:
multiple of deviation value that encompasses the specified probability. Maximum error of approx. 1.5X10E-9.

EspressReport 6.6