Package org.jfree.chart.renderer
Class HighLow
java.lang.Object
org.jfree.chart.renderer.HighLow
public class HighLow extends Object
Represents one point in the high/low/open/close plot.
All the coordinates in this class are in Java2D space.
- Author:
- Andrzej Porebski
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HighLow(double x, double high, double low)
Constructs a high-low item, with default values for the open/close and colors.HighLow(double x, double high, double low, double open, double close)
Constructs a high-low item, with default values for the colors.HighLow(double x, double high, double low, double open, double close, Stroke stroke, Paint paint)
Constructs a high-low item. -
Method Summary
Modifier and Type Method Description Rectangle2D
getBounds()
Returns the bounds.Line2D
getCloseTickLine()
Returns the line for close tickLine2D
getLine()
Returns the line.Line2D
getOpenTickLine()
Returns the line for open tick.Paint
getPaint()
Returns the Paint object used to color the line.Stroke
getStroke()
Returns the Stroke object used to draw the line.double
getTickSize()
Returns the width of the open/close tick.double
getValue(int valueType)
Returns either OPEN or CLOSE value depending on the valueType.void
setTickSize(double newSize)
Sets the width of the open/close tick.void
setValue(int type, double value)
Sets either OPEN or Close value depending on the valueType.
-
Field Details
-
OPEN
public static final int OPENUseful constant for open/close value types.- See Also:
- Constant Field Values
-
CLOSE
public static final int CLOSEUseful constant for open/close value types.- See Also:
- Constant Field Values
-
-
Constructor Details
-
HighLow
public HighLow(double x, double high, double low)Constructs a high-low item, with default values for the open/close and colors.- Parameters:
x
- the x value.high
- the high value.low
- the low value.
-
HighLow
public HighLow(double x, double high, double low, double open, double close)Constructs a high-low item, with default values for the colors.- Parameters:
x
- the x value.high
- the high value.low
- the low value.open
- the open value.close
- the close value.
-
HighLow
public HighLow(double x, double high, double low, double open, double close, Stroke stroke, Paint paint)Constructs a high-low item.- Parameters:
x
- the x value.high
- the high value.low
- the low value.open
- the open value.close
- the close value.stroke
- the stroke.paint
- the paint.
-
-
Method Details
-
setTickSize
public void setTickSize(double newSize)Sets the width of the open/close tick.- Parameters:
newSize
- the new tick size.
-
getTickSize
public double getTickSize()Returns the width of the open/close tick.- Returns:
- the width of the open/close tick.
-
getLine
Returns the line.- Returns:
- the line.
-
getBounds
Returns the bounds.- Returns:
- the bounds.
-
getValue
public double getValue(int valueType)Returns either OPEN or CLOSE value depending on the valueType.- Parameters:
valueType
- which value{OPEN|CLOSE}
.- Returns:
- the open value for valueType
OPEN
, the close value otherwise.
-
setValue
public void setValue(int type, double value)Sets either OPEN or Close value depending on the valueType.- Parameters:
type
- the value type (OPEN or CLOSE).value
- the new value.
-
getOpenTickLine
Returns the line for open tick.- Returns:
- the line for open tick.
-
getCloseTickLine
Returns the line for close tick- Returns:
- the line for close tick.
-
getStroke
Returns the Stroke object used to draw the line.- Returns:
- the Stroke object used to draw the line.
-
getPaint
Returns the Paint object used to color the line.- Returns:
- the Paint object used to color the line.
-