Class ErrorBar

java.lang.Object
org.swtchart.internal.series.ErrorBar
All Implemented Interfaces:
IErrorBar

public class ErrorBar extends Object implements IErrorBar
The error bar.
  • Constructor Details

    • ErrorBar

      public ErrorBar()
      The constructor.
  • Method Details

    • getType

      public IErrorBar.ErrorBarType getType()
      Description copied from interface: IErrorBar
      Gets the error type.
      Specified by:
      getType in interface IErrorBar
      Returns:
      the error type
    • setType

      public void setType(IErrorBar.ErrorBarType type)
      Description copied from interface: IErrorBar
      Sets the error type.
      Specified by:
      setType in interface IErrorBar
      Parameters:
      type - the error type
    • getColor

      public Color getColor()
      Description copied from interface: IErrorBar
      Gets the error bar color. The default color is dark gray.
      Specified by:
      getColor in interface IErrorBar
      Returns:
      the error bar color
    • setColor

      public void setColor(Color color)
      Description copied from interface: IErrorBar
      Sets the error bar color. If null is given, default color will be set.
      Specified by:
      setColor in interface IErrorBar
      Parameters:
      color - the error bar color
    • getLineWidth

      public int getLineWidth()
      Description copied from interface: IErrorBar
      Gets the line width to draw error bar.
      Specified by:
      getLineWidth in interface IErrorBar
      Returns:
      the line width to draw error bar
    • setLineWidth

      public void setLineWidth(int width)
      Description copied from interface: IErrorBar
      Sets the line width to draw error bar. The default line width is 1.
      Specified by:
      setLineWidth in interface IErrorBar
      Parameters:
      width - line width to draw error bar
    • getError

      public double getError()
      Description copied from interface: IErrorBar
      Gets the error.
      Specified by:
      getError in interface IErrorBar
      Returns:
      the error
    • setError

      public void setError(double error)
      Description copied from interface: IErrorBar
      Sets the error.

      If errors have been set with IErrorBar.getPlusErrors() or IErrorBar.getMinusErrors(), the value set with this method won't be used.

      Specified by:
      setError in interface IErrorBar
      Parameters:
      error - the error
    • getPlusErrors

      public double[] getPlusErrors()
      Description copied from interface: IErrorBar
      Gets the plus errors.
      Specified by:
      getPlusErrors in interface IErrorBar
      Returns:
      the plus errors, or empty array if errors are not set.
    • setPlusErrors

      public void setPlusErrors(double[] errors)
      Description copied from interface: IErrorBar
      Sets the plus errors.
      Specified by:
      setPlusErrors in interface IErrorBar
      Parameters:
      errors - the plus errors
    • getMinusErrors

      public double[] getMinusErrors()
      Description copied from interface: IErrorBar
      Gets the minus errors.
      Specified by:
      getMinusErrors in interface IErrorBar
      Returns:
      the minus errors, or empty array if errors are not set.
    • setMinusErrors

      public void setMinusErrors(double[] errors)
      Description copied from interface: IErrorBar
      Sets the minus errors.
      Specified by:
      setMinusErrors in interface IErrorBar
      Parameters:
      errors - the minus errors
    • isVisible

      public boolean isVisible()
      Description copied from interface: IErrorBar
      Gets the visibility state.
      Specified by:
      isVisible in interface IErrorBar
      Returns:
      true if error bar is visible
    • setVisible

      public void setVisible(boolean visible)
      Description copied from interface: IErrorBar
      Sets the visibility state.
      Specified by:
      setVisible in interface IErrorBar
      Parameters:
      visible - the visibility state
    • draw

      protected void draw(GC gc, int h, int v, Axis axis, int seriesIndex)
      Draws error bar.
      Parameters:
      gc - the graphics context
      h - the horizontal coordinate to draw error bar
      v - the vertical coordinate to draw error bar
      axis - the x axis
      seriesIndex - the series index