com.jinsight.jetchart
Class TargetLine

java.lang.Object
  extended bycom.jinsight.jetchart.TargetLine

public class TargetLine
extends java.lang.Object

This class implements the properties and methods of a target line. A target line is used to compare series data points values against an indicator, which represents a goal to achieve or a limit to be avoided.
The number of target lines that can be created and added to a chart is unlimited.

See Also:
GraphSet, GraphSet.addTargetLine(com.jinsight.jetchart.TargetLine)

Field Summary
static int ABOVE_CENTER
          Constant used to place the target line text centered above the target line.
static int ABOVE_LEFT
          Constant used to place the target line text above and to the left of the target line.
static int ABOVE_RIGHT
          Constant used to place the target line text above and to the right of the target line.
static int BEHIND
          If chart is 2D, this constant is used to place a target line behind the grid and all series.
static int BELOW_CENTER
          Constant used to place the target line text centered below the target line.
static int BELOW_LEFT
          Constant used to place the target line text below and to the left of the target line.
static int BELOW_RIGHT
          Constant used to place the target line text below and to the right of the target line.
static int FRONT
          If chart is 2D, this constant is used to place a target line in front of the grid and all series.
 
Constructor Summary
TargetLine()
          Default constructor of the TargetLine class.
TargetLine(double value)
          Constructor of the TargetLine class.
 
Method Summary
protected  void finalize()
           
 void setColor(java.awt.Color color)
          Sets the color of a target line.
 void setFont(java.awt.Font font)
          Sets the font of the target line text.
 void setHorizontalEnabled(boolean isHorizontalEnabled)
          Sets the orientation of a target line to horizontal or vertical.
static void setPosition(int position)
          Sets the position where all target lines are painted.
 void setText(java.lang.String text)
          Sets the text to be displayed next to the target line.
 void setTextColor(java.awt.Color textColor)
          Sets the color of the target line text.
 void setTextPosition(int textPosition)
          Sets the target line text position.
 void setThickness(int thickness)
          Sets the target line thickness.
 void setValue(double value)
          Sets the target line value.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABOVE_CENTER

public static final int ABOVE_CENTER
Constant used to place the target line text centered above the target line.

See Also:
Constant Field Values

ABOVE_LEFT

public static final int ABOVE_LEFT
Constant used to place the target line text above and to the left of the target line.

See Also:
Constant Field Values

ABOVE_RIGHT

public static final int ABOVE_RIGHT
Constant used to place the target line text above and to the right of the target line.

See Also:
Constant Field Values

BELOW_CENTER

public static final int BELOW_CENTER
Constant used to place the target line text centered below the target line.

See Also:
Constant Field Values

BELOW_LEFT

public static final int BELOW_LEFT
Constant used to place the target line text below and to the left of the target line.

See Also:
Constant Field Values

BELOW_RIGHT

public static final int BELOW_RIGHT
Constant used to place the target line text below and to the right of the target line.

See Also:
Constant Field Values

FRONT

public static final int FRONT
If chart is 2D, this constant is used to place a target line in front of the grid and all series.

See Also:
Constant Field Values

BEHIND

public static final int BEHIND
If chart is 2D, this constant is used to place a target line behind the grid and all series.

See Also:
Constant Field Values
Constructor Detail

TargetLine

public TargetLine()
Default constructor of the TargetLine class.


TargetLine

public TargetLine(double value)
Constructor of the TargetLine class. The target line is positioned at the coordinate corresponding to the value taken as parameter.

Parameters:
value - A double precision number.
Method Detail

setValue

public void setValue(double value)
Sets the target line value. The target line is positioned at the coordinate corresponding to the value taken as parameter.

Parameters:
value - A double precision number.

setThickness

public void setThickness(int thickness)
Sets the target line thickness. Default value is 1 pixel. This method only affects 2D charts.

Parameters:
thickness - An integer number, equal to or greater than 1.

setColor

public void setColor(java.awt.Color color)
Sets the color of a target line. Default color is red.

Parameters:
color - A Color object.

setPosition

public static void setPosition(int position)
Sets the position where all target lines are painted. Target lines can be painted in front of or behind the grid and all series. This static method only affects two dimensional charts. The default position is in front of all series and grid.

Parameters:
position - An integer value.
See Also:
FRONT, BEHIND

setText

public void setText(java.lang.String text)
Sets the text to be displayed next to the target line.

Parameters:
text - A String object.

setTextColor

public void setTextColor(java.awt.Color textColor)
Sets the color of the target line text. Default color is black.

Parameters:
textColor - A Color object.
See Also:
setText(java.lang.String)

setFont

public void setFont(java.awt.Font font)
Sets the font of the target line text. By default the font is 'SansSerif', plain and size is 10.

Parameters:
font - A Font object.
See Also:
setText(java.lang.String)

setTextPosition

public void setTextPosition(int textPosition)
Sets the target line text position. By default the text position is set to ABOVE_CENTER.

Parameters:
textPosition - An integer number.
See Also:
setText(java.lang.String), ABOVE_CENTER, ABOVE_LEFT, ABOVE_RIGHT, BELOW_CENTER, BELOW_LEFT, BELOW_RIGHT

setHorizontalEnabled

public void setHorizontalEnabled(boolean isHorizontalEnabled)
Sets the orientation of a target line to horizontal or vertical. This method has no effect with charts painted using the class com.jinsight.jetchart.Graph. This chart context automatically sets target lines orientation to match the orientation specified for the entire graph. This method only takes effect with scatter charts.
The default orientation of target lines is vertical.

Parameters:
isHorizontalEnabled - A boolean value(true/false)
See Also:
Graph, ScatterGraph, GraphSet.addTargetLine(com.jinsight.jetchart.TargetLine), ScatterGraph.addTargetLine(com.jinsight.jetchart.TargetLine)

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable