Package quadbase.util

Interface ITrendLine

All Superinterfaces:
Cloneable, IDataLine, IReferenceObj

public interface ITrendLine extends IDataLine
  • Field Details

  • Method Details

    • 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:
    • getLineValue

      double getLineValue()
      Get the line value used by horizontal/vertical line type
      Specified by:
      getLineValue in interface IDataLine
      See Also:
    • 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(Color color, double mDev, String label)
      Draw lines at multiples of deviation value for a NORMAL curve only works for Histogram charts with setLinearScale invalid input: '&' 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.