com.jinsight.jetchart
Class XYBarSerie

java.lang.Object
  extended bycom.jinsight.jetchart.AbstractSerie
      extended bycom.jinsight.jetchart.ScatterSerie
          extended bycom.jinsight.jetchart.XYBarSerie

public class XYBarSerie
extends ScatterSerie

This class implements the properties and methods of an XY bar series. A data point of an XY bar series is associated with three values. The first and second values determine the horizontal position of the left and right sides of a vertical bar, respectively, calculated against the horizontal scale of a scatter graph, whereas the third value determines the bar's height, calculated against the vertical scale of a scatter graph.
The bars rest on the horizontal axis by default. However, floating bars can be achieved by setting the method setFloatingEnabled(boolean isFloatingEnabled) to true. The height of floating bars can be specified with the methods setHeight(int height) and setHeights(int[] heights). The former accepts an integer value, which is applied to the height of all bars, whereas the latter allows for specifying an individual height to each bar.
One of the applications an XY bar series is intended for is the plotting of histograms, consisting of vertical bars whose widths represent the range of similar data gathered in discrete groups, and the heights are the values that correspond to the data frequency within each group.

See Also:
ScatterSerie

Field Summary
 
Fields inherited from class com.jinsight.jetchart.AbstractSerie
CLIENT_SIDE, SERVER_SIDE_CERN, SERVER_SIDE_NCSA
 
Constructor Summary
XYBarSerie()
          Creates an XYBarSerie object.
XYBarSerie(double[][] multipleValues)
          Creates an XYBarSerie object.
XYBarSerie(double[][] multipleValues, java.lang.String title)
          Creates an XYBarSerie object.
 
Method Summary
 void setBorderColor(java.awt.Color borderColor)
          Sets the color of the border that surrounds each bar.
 void setColors(java.awt.Color[] colors)
          Sets an individual color for each bar.
 void setFloatingEnabled(boolean isFloatingEnabled)
          Enables/disables floating bars.
 void setHeight(int height)
          Sets the bars' height.
 void setHeightCenteredEnabled(boolean isCenteredHeightEnabled)
          Enables/disables vertical centering of floating bars with the vertical coordinate of the corresponding y value.
 void setHeights(int[] heights)
          Sets an individual height for each bar.
 
Methods inherited from class com.jinsight.jetchart.ScatterSerie
finalize, getColor, getMultipleValues, getRegressionLine, getSerieMap, getTitle, removeRegressionLine, setColor, setDateFormat, setDateFormat, setDateValues, setMultipleValues, setTitle, setToolTipDateFormat, setToolTipDateFormat, setToolTipText, setValuesFormat, setValuesQuery
 
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
 

Constructor Detail

XYBarSerie

public XYBarSerie()
Creates an XYBarSerie object. Default constructor.


XYBarSerie

public XYBarSerie(double[][] multipleValues)
Creates an XYBarSerie object. This method takes a bidimensional array of double values, each subarray containing three values. The first and second values are used to calculate the coordinates of the left and right sides of a bar against the horizontal scale of a scatter chart, whereas the third value determines the bar's top coordinate, calculated against the vertical scale.

Parameters:
multipleValues - Bidimensional array of double precision numbers.
See Also:
AbstractSerie.setMultipleValues(double[][])

XYBarSerie

public XYBarSerie(double[][] multipleValues,
                  java.lang.String title)
Creates an XYBarSerie object. This method takes a bidimensional array of double values and the series title, which is displayed in the legend box. Each subarray of the bidimensional array contains three values. The first and second values are used to calculate the coordinates of the left and right sides of a bar against the horizontal scale of a scatter chart, whereas the third value determines the bar's top coordinate, calculated against the vertical scale.

Parameters:
multipleValues - Bidimensional array of double precision numbers.
title - A String object.
See Also:
AbstractSerie.setMultipleValues(double[][])
Method Detail

setBorderColor

public void setBorderColor(java.awt.Color borderColor)
Sets the color of the border that surrounds each bar. Default color is black.

Parameters:
borderColor - A Color object.

setColors

public void setColors(java.awt.Color[] colors)
Sets an individual color for each bar. The colors are assigned to the bars in the same order their respective values are found in the array of values. If the length of the colors array is smaller than the number of data points, the remaining data points are painted in the default color or the color passed to the method ScatterSerie.setColor(Color color).

Parameters:
colors - An array of Color objects.
See Also:
ScatterSerie.setColor(java.awt.Color)

setHeight

public void setHeight(int height)
Sets the bars' height. This method only has effect if floating bars are enabled. Default height is 10 pixels. A height smaller than 1 is reset to 10 pixels.

Parameters:
height - An integer value, greater than or equal to 1.
See Also:
setFloatingEnabled(boolean), setHeights(int[])

setHeights

public void setHeights(int[] heights)
Sets an individual height for each bar. The heights are assigned to the bars in the same order their respective values are found in the array of values. If the length of the heights array is smaller than the number of data points, the remaining data points are assigned the default height or the height passed to the method setHeight(int height). A height smaller than 1 is reset to 10 pixels.
This method only has effect if floating bars are enabled.

Parameters:
heights - An array of integer numbers, greater than or equal to 1.
See Also:
setHeight(int), setFloatingEnabled(boolean)

setFloatingEnabled

public void setFloatingEnabled(boolean isFloatingEnabled)
Enables/disables floating bars. If enabled, the height of each bar is that specified with the method setHeight(int height) or setHeights(int[] heights), otherwise the height is the distance from the top of each bar to the horizontal axis.

Parameters:
isFloatingEnabled - A boolean value(true/false).
See Also:
setHeight(int), setHeights(int[])

setHeightCenteredEnabled

public void setHeightCenteredEnabled(boolean isCenteredHeightEnabled)
Enables/disables vertical centering of floating bars with the vertical coordinate of the corresponding y value. Default value is false. This method only has effect with floating bars.

Parameters:
isCenteredHeightEnabled - A boolean value(true/false).
See Also:
setFloatingEnabled(boolean)