com.jinsight.jetchart
Class GraphSerie

java.lang.Object
  |
  +--com.jinsight.jetchart.AbstractSerie
        |
        +--com.jinsight.jetchart.GraphSerie
Direct Known Subclasses:
AreaSerie, BarSerie, ImageSerie, LineSerie, OHLCSerie, PointSerie

public abstract class GraphSerie
extends AbstractSerie

This class is the superclass of all series whose data points are plotted against only one scale and are associated with descriptive labels, as line series, bar series, area series,etc.

See Also:
AbstractSerie

Field Summary
static int ABOVE_TOP_YAXIS
          Constant used to display the series title above the top and to the right of the y axis.
static int AREA
          Identifies the series as an area series.
static int BAR
          Identifies the series as a bar series.
static int BAR_HLC
          Identifies the series as an HLC bar series.
static int BAR_OHLC
          Identifies the series as an OHLC bar series.
static int BESIDE_TOP_YAXIS
          Constant used to display the series title beside the top and to the right of the y axis.
static int CANDLESTICK
          Identifies the series as a candlestick series.
static int DASHED
          Constant used to set the line style of line series and OHLC/HLC line series to dashed.
static int EMPTY_CIRCLE_MARK
          Constant used to set marks style to an empty circle.
static int EMPTY_DIAMOND_MARK
          Constant used to set marks style to an empty diamond.
static int EMPTY_SQUARE_MARK
          Constant used to set marks style to an empty square.
static int EMPTY_TRIANGLE_MARK
          Constant used to set marks style to an empty triangle.
static int IMAGE
          Identifies the series as an image series.
static int LEGEND
          Constant used to display the series title inside the legend box.
static int LINE
          Identifies the series as a line series.
static int LINE_HLC
          Identifies the series as an HLC line series.
static int LINE_OHLC
          Identifies the series as an OHLC line series.
static int MARK_SHAPE_LEGEND
          Constant used to set the legend style of line series and OHLC/HLC line series to the shape of respective series' marks.
static int POINT
          Identifies the series as a point series.
static int ROUNDED_CANDLESTICK
          Identifies the series as a rounded candlestick series.
static int SOLID
          Constant used to set the line style of line series and OHLC/HLC line series to solid.
static int SOLID_CIRCLE_MARK
          Constant used to set marks style to a solid circle.
static int SOLID_DIAMOND_MARK
          Constant used to set marks style to a solid diamond.
static int SOLID_SQUARE_LEGEND
          Constant used to set the legend style of line series and OHLC/HLC line series to a solid square.
static int SOLID_SQUARE_MARK
          Constant used to set marks style to a solid square.
static int SOLID_TRIANGLE_MARK
          Constant used to set marks style to a solid triangle.
static int STACKED_BAR
          Identifies the series as a stacked bars series.
static int X_MARK
          Constant used to set marks style to an X letter.
 
Fields inherited from class com.jinsight.jetchart.AbstractSerie
CLIENT_SIDE, SERVER_SIDE_CERN, SERVER_SIDE_NCSA
 
Method Summary
protected  void finalize()
           
 java.awt.Color getColor()
          Returns the color of this series.
 double[][] getMultipleValues()
          Returns a bidimensional array of multiple values.
 RegressionLine getRegressionLine()
          Returns a reference to a RegressionLine object.
 java.lang.String getSerieMap(java.lang.String[] urls, int type, java.lang.String target)
          Creates a chart image map.
 java.lang.String getSerieMap(java.lang.String[] urls, java.lang.String target, boolean addLabels)
          Creates a chart image map.
 java.lang.String getSerieMap(java.lang.String[] urls, java.lang.String target, java.lang.String[] labels)
          Creates a chart image map.
 java.lang.String getTitle()
          Returns the series title.
 int getType()
          Returns the series type.
 double[] getValues()
          Returns series values.
 void removeRegressionLine()
          Removes the regression line object.
 void setColor(java.awt.Color color)
          Sets series color.
 void setCoordinatesStatus(int[] coordinatesStatus)
          Sets the visibility status of a sequence of data points.
 void setFont(java.awt.Font font)
          Sets series font.
 void setMarkLegendBackground(java.awt.Color markLegendBackground)
          Sets the color of mark legend background.
 void setMarkLegendEnabled(boolean isMarkLegendEnabled)
          Enables/disables legends on data points.
 void setMarkLegendForeground(java.awt.Color markLegendForeground)
          Sets mark legend foreground color.
 void setMarkLegendOpacityEnabled(boolean isMarkLegendOpaque)
          Enables/disables mark legend opacity.
 void setMarksColor(java.awt.Color marksColor)
          Sets the color of the marks displayed on data points.
 void setMarksEnabled(boolean isMarksEnabled)
          Enables/disables marks on coordinates.
 void setMarksStyle(int marksStyle)
          Sets the style of data points' marks.
 void setMultipleValues(double[][] multipleValues)
          Sets the values of series whose data points are associated with multiple values, as OHLC series and scatter series.
 void setStartPoint(int startPoint)
          Sets a series starting point.
 void setTitle(java.lang.String title)
          Sets series title.
 void setTitleFont(java.awt.Font titleFont)
          Sets series title font.
 void setTitlePosition(int titlePosition)
          Sets the position where a series title is displayed.
 void setToolTipContent(java.lang.String[] toolTipContent)
          Customizes tooltips contents.
 void setValues(double[] values)
          Sets series values.
 void setValuesQuery(java.lang.String valuesQuery)
          Sets a sql query string to access a database and get series values.
 
Methods inherited from class com.jinsight.jetchart.AbstractSerie
getId, setHighlightColor, setHighlightEnabled, setId, setLegendEnabled, setMultipleValues, setSVGURLs, setToolTipEnabled, setValueFormat, setValues
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEGEND

public static final int LEGEND
Constant used to display the series title inside the legend box.

ABOVE_TOP_YAXIS

public static final int ABOVE_TOP_YAXIS
Constant used to display the series title above the top and to the right of the y axis.

BESIDE_TOP_YAXIS

public static final int BESIDE_TOP_YAXIS
Constant used to display the series title beside the top and to the right of the y axis.

LINE

public static final int LINE
Identifies the series as a line series.
See Also:
getType()

BAR

public static final int BAR
Identifies the series as a bar series.
See Also:
getType()

STACKED_BAR

public static final int STACKED_BAR
Identifies the series as a stacked bars series.
See Also:
getType()

AREA

public static final int AREA
Identifies the series as an area series.
See Also:
getType()

IMAGE

public static final int IMAGE
Identifies the series as an image series.
See Also:
getType()

POINT

public static final int POINT
Identifies the series as a point series.
See Also:
getType()

BAR_OHLC

public static final int BAR_OHLC
Identifies the series as an OHLC bar series. An OHLC bar series displays both left and right dashes.
See Also:
getType(), OHLCBarSerie

BAR_HLC

public static final int BAR_HLC
Identifies the series as an HLC bar series. An HLC bar series only displays the right dash, and the tooltip will only display the high, low and close value.
See Also:
getType(), OHLCBarSerie

LINE_OHLC

public static final int LINE_OHLC
Identifies the series as an OHLC line series. An OHLC line series displays all four values(open,high,low and close) in the tooltip.
See Also:
getType(), OHLCLineSerie

LINE_HLC

public static final int LINE_HLC
Identifies the series as an HLC line series. An HLC line series only displays the high,low, and close values in the tooltip.
See Also:
getType(), OHLCLineSerie

CANDLESTICK

public static final int CANDLESTICK
Identifies the series as a candlestick series.
See Also:
getType(), CandleStickSerie

ROUNDED_CANDLESTICK

public static final int ROUNDED_CANDLESTICK
Identifies the series as a rounded candlestick series.
See Also:
getType(), CandleStickSerie

SOLID_SQUARE_MARK

public static final int SOLID_SQUARE_MARK
Constant used to set marks style to a solid square.

EMPTY_SQUARE_MARK

public static final int EMPTY_SQUARE_MARK
Constant used to set marks style to an empty square.

SOLID_TRIANGLE_MARK

public static final int SOLID_TRIANGLE_MARK
Constant used to set marks style to a solid triangle.

EMPTY_TRIANGLE_MARK

public static final int EMPTY_TRIANGLE_MARK
Constant used to set marks style to an empty triangle.

SOLID_DIAMOND_MARK

public static final int SOLID_DIAMOND_MARK
Constant used to set marks style to a solid diamond.

EMPTY_DIAMOND_MARK

public static final int EMPTY_DIAMOND_MARK
Constant used to set marks style to an empty diamond.

SOLID_CIRCLE_MARK

public static final int SOLID_CIRCLE_MARK
Constant used to set marks style to a solid circle.

EMPTY_CIRCLE_MARK

public static final int EMPTY_CIRCLE_MARK
Constant used to set marks style to an empty circle.

X_MARK

public static final int X_MARK
Constant used to set marks style to an X letter.

SOLID

public static final int SOLID
Constant used to set the line style of line series and OHLC/HLC line series to solid.

DASHED

public static final int DASHED
Constant used to set the line style of line series and OHLC/HLC line series to dashed.

SOLID_SQUARE_LEGEND

public static final int SOLID_SQUARE_LEGEND
Constant used to set the legend style of line series and OHLC/HLC line series to a solid square.

MARK_SHAPE_LEGEND

public static final int MARK_SHAPE_LEGEND
Constant used to set the legend style of line series and OHLC/HLC line series to the shape of respective series' marks.
Method Detail

getValues

public double[] getValues()
Description copied from class: AbstractSerie
Returns series values.
Overrides:
getValues in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Returns:
An array of double precision numbers.
See Also:
AbstractSerie.setValues(double[])

getMultipleValues

public double[][] getMultipleValues()
Description copied from class: AbstractSerie
Returns a bidimensional array of multiple values. This method must be invoked to return values from series that supports multiple values, like scatter series and OHLC series.
Overrides:
getMultipleValues in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Returns:
A bidimensional array of double precision numbers.
See Also:
AbstractSerie.setMultipleValues(double[][]), OHLCSerie

setFont

public void setFont(java.awt.Font font)
Sets series font. The series font is used to set the font of data points legends.
Parameters:
font - A Font object.
See Also:
setMarkLegendEnabled(boolean)

getType

public int getType()
Returns the series type.
Returns:
One of the constants used to identify a series type.
See Also:
LINE, BAR, STACKED_BAR, AREA, IMAGE, POINT, BAR_OHLC, BAR_HLC, LINE_OHLC, LINE_HLC, CANDLESTICK, ROUNDED_CANDLESTICK

getRegressionLine

public RegressionLine getRegressionLine()
Returns a reference to a RegressionLine object. Stacked bars series do not support regression lines.
Returns:
a RegressionLine object.
See Also:
RegressionLine

removeRegressionLine

public void removeRegressionLine()
Removes the regression line object. A single instance of a RegressionLine is created by a series object when the method getRegressionLine() is invoked. Invoke this method to get rid of the RegressionLine object.
See Also:
getRegressionLine()

setCoordinatesStatus

public void setCoordinatesStatus(int[] coordinatesStatus)
Sets the visibility status of a sequence of data points. It is represented as a sequence of integer numbers using the binary digits '0' and '1'. A value of '0' means that the data point must not be displayed, whereas a value of '1' keeps the data point visible. The binary sequence follows the sequence of labels in the labels array. This method has no effect with area series and OHLC series.
Parameters:
coordinatesStatus - An integer array of binary values(0 or 1).
See Also:
Graph.setLabels(java.lang.String[]), LineSerie

setMarksEnabled

public void setMarksEnabled(boolean isMarksEnabled)
Enables/disables marks on coordinates. If enabled, a small square is displayed on series data points. Default value is true.
Only line series and OHLC line series display marks on data points.
Parameters:
isMarksEnabled - A boolean value(true/false).
See Also:
LineSerie

setMarksColor

public void setMarksColor(java.awt.Color marksColor)
Sets the color of the marks displayed on data points.
Parameters:
marksColor - A Color object.
See Also:
setMarksEnabled(boolean)

setMarksStyle

public void setMarksStyle(int marksStyle)
Sets the style of data points' marks. Marks' style is a solid square by default.
Parameters:
marksStyle - An integer value.
See Also:
setMarksEnabled(boolean), SOLID_SQUARE_MARK, EMPTY_SQUARE_MARK, SOLID_TRIANGLE_MARK, EMPTY_TRIANGLE_MARK, SOLID_DIAMOND_MARK, EMPTY_DIAMOND_MARK, SOLID_CIRCLE_MARK, EMPTY_CIRCLE_MARK, X_MARK

setMarkLegendEnabled

public void setMarkLegendEnabled(boolean isMarkLegendEnabled)
Enables/disables legends on data points. A mark legend displays the value of the data point it is associated with. Mark legends are disabled by default.
Parameters:
isMarkLegendEnabled - A boolean value(true/false).

setMarkLegendOpacityEnabled

public void setMarkLegendOpacityEnabled(boolean isMarkLegendOpaque)
Enables/disables mark legend opacity. Mark legends are opaque by default.
Parameters:
isMarkLegendOpaque - A boolean value(true/false).
See Also:
setMarkLegendEnabled(boolean)

setMarkLegendForeground

public void setMarkLegendForeground(java.awt.Color markLegendForeground)
Sets mark legend foreground color. The text of a mark legend is painted in this color. The foreground is black by default.
Parameters:
markLegendForeground - A Color object.

setMarkLegendBackground

public void setMarkLegendBackground(java.awt.Color markLegendBackground)
Sets the color of mark legend background. The background is yellow by default.
Parameters:
markLegendBackground - A Color object.

setColor

public void setColor(java.awt.Color color)
Sets series color. This is also the color of series titles painted outside the legend box. The series color is Color.lightGray by default.
Parameters:
color - A Color object.
See Also:
Legend, setTitlePosition(int)

getColor

public java.awt.Color getColor()
Returns the color of this series.
Returns:
A Color object.
See Also:
setColor(java.awt.Color)

setToolTipContent

public void setToolTipContent(java.lang.String[] toolTipContent)
Description copied from class: AbstractSerie
Customizes tooltips contents. Tooltips usually display series values and optionally respective data points labels and a prefixed text. Customized tooltips take precedence over usual tooltips contents.
Overrides:
setToolTipContent in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Parameters:
toolTipContent - An array of strings.
See Also:
ToolTip, ToolTip.setType(int), ToolTip.setLabel(java.lang.String)

setTitle

public void setTitle(java.lang.String title)
Sets series title. The series title identifies a series. It can be displayed inside the legend box, above or beside the top of the y axis.
Parameters:
title - A String object.
See Also:
Legend, setTitlePosition(int), setTitleFont(java.awt.Font), LEGEND, ABOVE_TOP_YAXIS, BESIDE_TOP_YAXIS

getTitle

public java.lang.String getTitle()
Returns the series title.
Returns:
A String object.
See Also:
setTitle(java.lang.String)

setTitleFont

public void setTitleFont(java.awt.Font titleFont)
Sets series title font. A series title can be displayed inside the legend box or above/beside the top of the y axis. This method only affects series titles displayed above/beside the top of the y axis. To change the font of a series title displayed inside the legend box, use the Legend.setFont(Font font) method.
Parameters:
titleFont - A Font object.
See Also:
setTitlePosition(int), LEGEND, ABOVE_TOP_YAXIS, BESIDE_TOP_YAXIS, Legend.setFont(java.awt.Font)

setTitlePosition

public void setTitlePosition(int titlePosition)
Sets the position where a series title is displayed. Default position is inside the legend box. If chart is horizontal, the series titles are always displayed inside the legend box.
Parameters:
titlePosition - An integer value
See Also:
setTitle(java.lang.String), setTitleFont(java.awt.Font), LEGEND, ABOVE_TOP_YAXIS, BESIDE_TOP_YAXIS

setStartPoint

public void setStartPoint(int startPoint)
Sets a series starting point. The starting point must be an integer ranging from 0 to the length of a series values array minus 1. A series starting point specifies the index of the first data point to be painted.
Parameters:
startPoint - An integer number.
See Also:
AbstractSerie.setValues(double[]), AbstractSerie.setMultipleValues(double[][])

getSerieMap

public java.lang.String getSerieMap(java.lang.String[] urls,
                                    int type,
                                    java.lang.String target)
Description copied from class: AbstractSerie
Creates a chart image map. A image map is used in an HTML document to allow regions of an image to be linked to other HTML documents. The web browser will bring up a different document depending where on the image map the user clicks. The map itself is either a separate file (server-side maps) or part of the HTML document (client-side maps).
A client-side map can be inserted into html text to be returned by a servlet that also generates the chart image.
If the 'urls' parameter is informed, data points coordinates are associated with each element found in the array of urls. If hyperlinks are not required set the 'urls' parameter to null.
The second parameter sets the map format type. Image map can be generated in three different formats. A client-side map and an NCSA server or CERN server formatted map. The client-side map is the most used format.
The third parameter sets a target. The target is the name of an html frame used to display the page associated with the image map. This parameter is only related to client-side image mapping. If a target frame is not required set the 'target' parameter to null.
Overrides:
getSerieMap in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Parameters:
urls - An array of strings containing valid urls.
type - An integer representing the format type.
target - A string object.
See Also:
AbstractSerie.CLIENT_SIDE, AbstractSerie.SERVER_SIDE_NCSA, AbstractSerie.SERVER_SIDE_CERN

getSerieMap

public java.lang.String getSerieMap(java.lang.String[] urls,
                                    java.lang.String target,
                                    boolean addLabels)
Creates a chart image map. A image map is used in an HTML document to allow regions of an image to be linked to other HTML documents. The web browser will bring up a different document depending on the region of the image map clicked by user. The map itself is either a separate file (server-side maps) or part of the HTML document (client-side maps).
A client-side map can be inserted into html text to be returned by a charting servlet.
If the 'urls' parameter is informed, data points coordinates are associated with each element found in the array of urls. If hyperlinks are not required set the 'urls' parameter to null.
The second parameter sets a target. The target is the name of an html frame used to display the page associated with the image map. This parameter is only related to client-side image mapping. If a target frame is not required set the 'target' parameter to null.
If a client-side image map is generated, data points values are always inserted into the 'onMouseOver' and 'alt' attributes of the tag. By default, respective labels are not inserted. The 'addLabels' parameter is a flag that controls labels insertion into the tag. If true, data points labels are also inserted.
This variant of the getSerieMap method only applies to client-side maps.
Parameters:
urls - An array of strings containing valid urls.
target - A string object.
addLabels - a boolean value(true/false).

getSerieMap

public java.lang.String getSerieMap(java.lang.String[] urls,
                                    java.lang.String target,
                                    java.lang.String[] labels)
Creates a chart image map. A image map is used in an HTML document to allow regions of an image to be linked to other HTML documents. The web browser will bring up a different document depending on the region of the image map clicked by user. The map itself is either a separate file (server-side maps) or part of the HTML document (client-side maps).
A client-side map can be inserted into html text to be returned by a charting servlet.
If the 'urls' parameter is informed, data points coordinates are associated with each element found in the array of urls. If hyperlinks are not required set the 'urls' parameter to null.
The second parameter sets a target. The target is the name of an html frame used to display the page associated with the image map. This parameter is only related to client-side image mapping. If a target frame is not required set the 'target' parameter to null.
If a client-side map is generated, data points values are always inserted into the 'onMouseOver' and 'alt' attributes of the tag. By default, respective labels are not inserted. The 'labels' parameter is a list of strings containing description of values. If this parameter is informed, these strings are inserted into the image map along with respective values.
This variant of the getSerieMap method only applies to client-side maps.
Parameters:
urls - An array of strings containing valid urls.
target - A string object.
labels - An array of strings containing data points labels.

setValues

public void setValues(double[] values)
Description copied from class: AbstractSerie
Sets series values. Values are passed as an array of double precision numbers.
Overrides:
setValues in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Parameters:
values - An array of double precision numbers.

setMultipleValues

public void setMultipleValues(double[][] multipleValues)
Description copied from class: AbstractSerie
Sets the values of series whose data points are associated with multiple values, as OHLC series and scatter series. Multiple values must be passed as a bidimensional array of double precision numbers.
Overrides:
setMultipleValues in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Parameters:
multipleValues - A bidimensional array of double precision numbers.
See Also:
OHLCSerie, ScatterSerie

setValuesQuery

public void setValuesQuery(java.lang.String valuesQuery)
Description copied from class: AbstractSerie
Sets a sql query string to access a database and get series values. The query must return a number of columns equal to the number of values associated with a data point, otherwise an exception is raised.
Overrides:
setValuesQuery in class AbstractSerie
Following copied from class: com.jinsight.jetchart.AbstractSerie
Parameters:
valuesQuery - A sql query string.
See Also:
GenericGraph.setDriver(java.lang.String), GenericGraph.setConnection(java.lang.String, java.lang.String, java.lang.String), AbstractSerie.setValues(double[]), AbstractSerie.setMultipleValues(double[][])

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class AbstractSerie