Package org.swtchart.internal.series
Class ErrorBar
java.lang.Object
org.swtchart.internal.series.ErrorBar
- All Implemented Interfaces:
IErrorBar
The error bar.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.swtchart.IErrorBar
IErrorBar.ErrorBarType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Draws error bar.org.eclipse.swt.graphics.Color
getColor()
Gets the error bar color.double
getError()
Gets the error.int
Gets the line width to draw error bar.double[]
Gets the minus errors.double[]
Gets the plus errors.getType()
Gets the error type.boolean
Gets the visibility state.void
setColor
(org.eclipse.swt.graphics.Color color) Sets the error bar color.void
setError
(double error) Sets the error.void
setLineWidth
(int width) Sets the line width to draw error bar.void
setMinusErrors
(double[] errors) Sets the minus errors.void
setPlusErrors
(double[] errors) Sets the plus errors.void
Sets the error type.void
setVisible
(boolean visible) Sets the visibility state.
-
Constructor Details
-
ErrorBar
public ErrorBar()The constructor.
-
-
Method Details
-
getType
Description copied from interface:IErrorBar
Gets the error type. -
setType
Description copied from interface:IErrorBar
Sets the error type. -
getColor
public org.eclipse.swt.graphics.Color getColor()Description copied from interface:IErrorBar
Gets the error bar color. The default color is dark gray. -
setColor
public void setColor(org.eclipse.swt.graphics.Color color) Description copied from interface:IErrorBar
Sets the error bar color. If null is given, default color will be set. -
getLineWidth
public int getLineWidth()Description copied from interface:IErrorBar
Gets the line width to draw error bar.- Specified by:
getLineWidth
in interfaceIErrorBar
- 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 interfaceIErrorBar
- Parameters:
width
- line width to draw error bar
-
getError
public double getError()Description copied from interface:IErrorBar
Gets the error. -
setError
public void setError(double error) Description copied from interface:IErrorBar
Sets the error.If errors have been set with
IErrorBar.getPlusErrors()
orIErrorBar.getMinusErrors()
, the value set with this method won't be used. -
getPlusErrors
public double[] getPlusErrors()Description copied from interface:IErrorBar
Gets the plus errors.- Specified by:
getPlusErrors
in interfaceIErrorBar
- 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 interfaceIErrorBar
- Parameters:
errors
- the plus errors
-
getMinusErrors
public double[] getMinusErrors()Description copied from interface:IErrorBar
Gets the minus errors.- Specified by:
getMinusErrors
in interfaceIErrorBar
- 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 interfaceIErrorBar
- Parameters:
errors
- the minus errors
-
isVisible
public boolean isVisible()Description copied from interface:IErrorBar
Gets the visibility state. -
setVisible
public void setVisible(boolean visible) Description copied from interface:IErrorBar
Sets the visibility state.- Specified by:
setVisible
in interfaceIErrorBar
- Parameters:
visible
- the visibility state
-
draw
Draws error bar.- Parameters:
gc
- the graphics contexth
- the horizontal coordinate to draw error barv
- the vertical coordinate to draw error baraxis
- the x axisseriesIndex
- the series index
-