com.jinsight.jetchart
Class ScatterSerie

java.lang.Object
  extended bycom.jinsight.jetchart.AbstractSerie
      extended bycom.jinsight.jetchart.ScatterSerie
Direct Known Subclasses:
BubbleSerie, XYBarSerie, XYImageSerie, XYLineSerie, XYSerie

public abstract class ScatterSerie
extends AbstractSerie

This class implements the properties common to scatter series. Data points of scatter series are associated with two values each, representing a xy pair which is plotted against a horizontal and a vertical scales using the cartesian coordinates system. ScatterSerie is extended to implement more specialized series.

See Also:
AbstractSerie, XYSerie, XYLineSerie, BubbleSerie

Field Summary
 
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 getTitle()
          Returns the series title.
 void removeRegressionLine()
          Removes the regression line object.
 void setColor(java.awt.Color color)
          Sets series color.
 void setDateFormat(java.text.DateFormat dateFormat)
          Sets the expected format style of date values assigned to a time series.
 void setDateFormat(java.lang.String dateFormat)
          Sets the expected format style of date values assigned to a time series.
 void setDateValues(java.lang.String[] dateValues)
          Sets date/time values of time series.
 void setMultipleValues(double[][] multipleValues)
          Sets the values of series whose data points are associated with multiple values, as OHLC series, scatter series and polar series.
 void setTitle(java.lang.String title)
          Sets series title.
 void setToolTipDateFormat(java.text.DateFormat dateFormat)
          Sets the format style of dates displayed in tooltips.
 void setToolTipDateFormat(java.lang.String dateFormat)
          Sets the format style of dates displayed in tooltips.
 void setToolTipText(java.lang.String[] toolTipText)
          Sets the texts to prefix values displayed in tooltips.
 void setValuesFormat(java.lang.String[] valuesFormat)
          Sets the format of the x, y and z(bubble series) values, displayed in tooltips.
 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
addMultipleValues, addValue, getId, getValues, setHighlightColor, setHighlightEnabled, setId, setLegendEnabled, setMultipleValues, setSVGURLs, setToolTipContent, setToolTipEnabled, setValueFormat, setValues, setValues
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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, scatter series and polar series. Multiple values must be passed as a bidimensional array of double precision numbers.

Overrides:
setMultipleValues in class AbstractSerie
Parameters:
multipleValues - A bidimensional array of double precision numbers.
See Also:
OHLCSerie, ScatterSerie, PolarSerie

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
Returns:
A bidimensional array of double precision numbers.
See Also:
AbstractSerie.setMultipleValues(double[][]), OHLCSerie

setDateValues

public void setDateValues(java.lang.String[] dateValues)
Sets date/time values of time series. These values are timestamp strings that are parsed into milliseconds and are plotted against the horizontal scale of date/time charts. The timestamps are parsed according to the date/time pattern styles of classes java.text.DateFormat and java.text.SimpleDateFormat.
The date/time pattern can be informed with either forms of method setDateFormat, passing the format style either as a String or a property of a DateFormat object. SimpleDateFormat can be used to specify more complex patterns using the method SimpleDateFormat.applyPattern(String pattern).
By default, the expected date format corresponds to the localized SHORT style of class java.text.DateFormat for both date and time. A parsing exception is raised if the date/time pattern of the input strings does not match the expected format style.

This method only has effect if a date graph is enabled. If a date graph is enabled but no date values are informed, the horizontal axis values must be passed as milliseconds to the first dimension of the bidimensional array accepted by the method setMultipleValues(double[][] multipleValues).

Parameters:
dateValues - An array of strings
See Also:
ScatterGraph.setDateGraphEnabled(boolean), setMultipleValues(double[][]), setDateFormat(java.lang.String)

setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Sets the expected format style of date values assigned to a time series. This method takes a user-defined date/time format string as a sequence of pattern characters, as specified for the java.text.SimpleDateFormat class, to parse timestamps into milliseconds, which are used to calculate the positions of date/time values within the horizontal scale range.
By default, the expected date format corresponds to the localized SHORT style of class java.text.DateFormat for both date and time. A parsing exception is raised if the date values format does not match the expected format.
This method only has effect if date graph is enabled and date values are passed to a time series using the method setDateValues, and is only applicable to scatter charts.

Parameters:
dateFormat - A String object.
See Also:
setDateValues(java.lang.String[]), ScatterGraph.setDateGraphEnabled(boolean)

setDateFormat

public void setDateFormat(java.text.DateFormat dateFormat)
Sets the expected format style of date values assigned to a time series. This method takes a DateFormat object to parse timestamps into milliseconds, which are used to calculate the positions of date/time values within the horizontal scale range. It takes precedence over similar method that takes a date/time pattern string.
The format style corresponds to the date/time constants provided by the DateFormat class, as SHORT, MEDIUM, etc. The expected format is the one provided by the DateFormat object taken by this method, or any format provided by subclasses of DateFormat, as SimpleDateFormat, which implements the method applyPattern(String pattern) to specify a more complex format. A parsing exception is raised if the date values format does not match the expected format.
This method only has effect if date graph is enabled and date values are passed to a time series using the method setDateValues, and is only applicable to scatter charts.

Parameters:
dateFormat - A DateFormat object.
See Also:
setDateValues(java.lang.String[]), ScatterGraph.setDateGraphEnabled(boolean)

setToolTipDateFormat

public void setToolTipDateFormat(java.lang.String dateFormat)
Sets the format style of dates displayed in tooltips. The format style can be changed passing to this method a sequence of pattern characters, as specified for the class java.text.SimpleDateFormat. If the format style is not informed or null is passed, the dates are formatted using the SHORT style of the class java.text.DateFormat, both for date and time.
This method only has effect if date graph is enabled and the tooltip date format has not been informed with the overloaded form that takes a DateFormat object.

Parameters:
dateFormat - A String object
See Also:
ScatterGraph.setDateGraphEnabled(boolean)

setToolTipDateFormat

public void setToolTipDateFormat(java.text.DateFormat dateFormat)
Sets the format style of dates displayed in tooltips. This method takes a DateFormat object to specify the format style. It takes precedence over similar method that takes a date/time pattern string.
If a DateFormat object is not informed or null is passed, the dates are formatted using the DateFormat.SHORT style for both date and time.
This method only has effect if date graph is enabled, and is only applicable to scatter charts.

Parameters:
dateFormat - A String object.
See Also:
ScatterGraph.setDateGraphEnabled(boolean)

setTitle

public void setTitle(java.lang.String title)
Sets series title. The series title identifies a series, and it is displayed inside the legend box.

Parameters:
title - A String object.
See Also:
Legend

getTitle

public java.lang.String getTitle()
Returns the series title.

Returns:
A String object.
See Also:
setTitle(java.lang.String)

setColor

public void setColor(java.awt.Color color)
Sets series color. The series color is Color.lightGray by default.

Parameters:
color - A Color object.

getColor

public java.awt.Color getColor()
Returns the color of this series.

Returns:
A Color object.
See Also:
setColor(java.awt.Color)

setToolTipText

public void setToolTipText(java.lang.String[] toolTipText)
Sets the texts to prefix values displayed in tooltips. Default prefixes are:
"X:" and "Y:".
Bubble series take a third prefix to identify the z value, and the default prefixes are "X:", "Y:" and "Z:".

Parameters:
toolTipText - An array of String objects.
See Also:
BubbleSerie

setValuesFormat

public void setValuesFormat(java.lang.String[] valuesFormat)
Sets the format of the x, y and z(bubble series) values, displayed in tooltips. Default format is "#,###,##0.00", numbers are displayed with two decimals.

Parameters:
valuesFormat - An array of String objects.
See Also:
ToolTip

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 on the image map link the user clicks on. 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.

Specified by:
getSerieMap in class 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

getRegressionLine

public RegressionLine getRegressionLine()
Returns a reference to a RegressionLine object. A RegressionLine object is created by a scatter series only when this method is invoked.

Returns:
a RegressionLine object.
See Also:
RegressionLine, removeRegressionLine()

removeRegressionLine

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

See Also:
getRegressionLine()

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
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
Throws:
java.lang.Throwable