All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.swingchart.Chart
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----javax.swing.JComponent
|
+----com.ibm.eou.swingchart.Chart
- public abstract class Chart
- extends JComponent
- implements MouseMotionListener
This is the base class for all charts. To draw a chart, create an
instance of
BarChart,
ParallelChart,
PieChart,
PlotChart,
ScatterChart, or
SurfaceChart
- See Also:
- ParallelChart, PieChart, PlotChart, ScatterChart, StackChart, SurfaceChart
-
PARALLEL
- Parallel chart.
-
PIE
- Pie chart.
-
PLOT
- Plot chart.
-
SCATTER
- Scatter chart.
-
STACK
- Stacked bar chart.
-
SURFACE
- Surface chart.
-
Chart()
- Constructor
-
copyright()
- IBM Copyright
-
getColors()
- Return colors used to draw chart bars, lines, areas, and points.
-
getColors(int)
- Return single color used to draw chart bars, lines, areas, and points.
-
getLabelInterval()
- Return the interval for X axis labels.
-
getLabelList()
- Get labels list property.
-
getLabels()
- Get labels property.
-
getLabels(int)
- Return a single label identified by an index.
-
getLegendList()
- Get legends list property.
-
getLegends()
- Get legends.
-
getLegends(int)
- Return a single legend identified by an index.
-
getMinimumSize()
-
-
getPreferredSize()
-
-
getShowGridLines()
- Return option for displaying the grid lines in the chart
-
getShowYAxisValues()
- Return option for displaying values on Y axis
-
getValueGrid()
- Return the values as a DoubleGrid object.
-
getValues()
- Return the set of values displayed by chart
-
getValues(int, int)
- Return a specific chart value identified by a row and column index.
-
getYScaleAuto()
- Return y-axis automatic scaling
-
getYScaleMaximum()
- Return maximum value for y-axis
-
getYScaleMinimum()
- Return mimimum value for y-axis
-
mouseDragged(MouseEvent)
-
-
mouseMoved(MouseEvent)
-
-
paintChart(Graphics, ChartData, ChartMetrics)
- Overridden by subclasses to paint type specific chart using metrics
supplied in
metrics and data supplied in chartData.
-
paintComponent(Graphics)
-
-
setColors(Color[])
- Set colors for drawing chart bars, lines, areas, and points.
-
setColors(int, Color)
- Set a single color used to draw chart bars, lines, areas, and points.
-
setLabelInterval(int)
- Set the interval for x axis labels.
-
setLabelList(StringList)
- Set labels list property.
-
setLabels(int, String)
- Set a single label.
-
setLabels(String[])
- Set labels property.
-
setLegendList(StringList)
- Set legends list property.
-
setLegends(int, String)
- Set a single legend.
-
setLegends(String[])
- Set legends property.
-
setShowGridLines(boolean)
- Set option for displaying the grid lines in the chart
-
setShowYAxisValues(boolean)
- Set option for displaying values on Y axis
-
setValueGrid(DoubleGrid)
- Sets the values as a DoubleGrid object.
-
setValues(double[][])
- Set a group of values to be displayed by the chart.
-
setValues(int, int, double)
- Set a single value to be displayed by the chart, identified by row and column
index numbers.
-
setYScaleAuto(boolean)
- Set y-axis automatic scaling
-
setYScaleMaximum(double)
- Set maximum value for y-axis scale if automatic scaling is set off.
-
setYScaleMinimum(double)
- Set minimum value for y-axis if automatic scaling is set off.
STACK
public static final int STACK
- Stacked bar chart.
Shows a bar for each range for each x value.
Bars are stacked vertically.
SCATTER
public static final int SCATTER
- Scatter chart.
Shows a point for each range for each x value.
PLOT
public static final int PLOT
- Plot chart.
Plots a line for each range for each x value.
SURFACE
public static final int SURFACE
- Surface chart.
Plots a line for each range for each x value. Lines are plotted cumulatively and
the area between the lines is filled.
PIE
public static final int PIE
- Pie chart.
PARALLEL
public static final int PARALLEL
- Parallel chart.
Shows a bar for each range for each x value.
Bars are abutted horizontally.
Chart
public Chart()
- Constructor
copyright
public static String copyright()
- IBM Copyright
getColors
public Color[] getColors()
- Return colors used to draw chart bars, lines, areas, and points.
- Returns:
- Array of color objects
getColors
public Color getColors(int index)
- Return single color used to draw chart bars, lines, areas, and points. The
color is identified by an index number.
- Parameters:
- index - Index of color to return
- Returns:
- Color
getLabelInterval
public int getLabelInterval()
- Return the interval for X axis labels.
- See Also:
- setLabelInterval
getLabelList
public StringList getLabelList()
- Get labels list property.
This method is primarily provided for the benefit of property editors.
When wiring beans or using the API, use the alternative method
- Returns:
- Column names list encapsulated in an instance of StringList
- See Also:
- getLabels, StringList
getLabels
public String[] getLabels()
- Get labels property.
- Returns:
- Column names as array
- See Also:
- getLabelList
getLabels
public String getLabels(int index)
- Return a single label identified by an index.
- Parameters:
- index - Index of label to return
- Returns:
- Label
getLegendList
public StringList getLegendList()
- Get legends list property.
This method is primarily provided for the benefit of property editors.
When wiring beans or using the API, use the alternative method
getLegends.
- Returns:
- Column names list encapsulated in an instance of StringList
- See Also:
- getLegends, StringList
getLegends
public String[] getLegends()
- Get legends.
- Returns:
- Column names as array
- See Also:
- getLegendList
getLegends
public String getLegends(int index)
- Return a single legend identified by an index.
- Parameters:
- index - Index of legend to return
- Returns:
- Legend
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class JComponent
getShowGridLines
public boolean getShowGridLines()
- Return option for displaying the grid lines in the chart
- Returns:
- true-show grid false-do not show grid
getShowYAxisValues
public boolean getShowYAxisValues()
- Return option for displaying values on Y axis
- Returns:
- true-show values false-do not show values
getValueGrid
public DoubleGrid getValueGrid()
- Return the values as a DoubleGrid object.
This method is provided primarily for property editors.
When wiring beans or using the API, use the alternative method
getValues.
- Returns:
- com.ibm.eou.swingchart.DoubleGrid
- See Also:
- getValues
getValues
public double[][] getValues()
- Return the set of values displayed by chart
- Returns:
- Chart values as a 2D array of doubles
getValues
public double getValues(int rowIndex,
int columnIndex)
- Return a specific chart value identified by a row and column index.
- Parameters:
- rowIndex - 0 based row index
- columnIndex - 0 based column index
- Returns:
- value
getYScaleAuto
public boolean getYScaleAuto()
- Return y-axis automatic scaling
- Returns:
- true-y-axis automatic scaling on
getYScaleMaximum
public double getYScaleMaximum()
- Return maximum value for y-axis
- Returns:
- Maximum value
- See Also:
- getYScaleMinimum
getYScaleMinimum
public double getYScaleMinimum()
- Return mimimum value for y-axis
- Returns:
- Minimum value
- See Also:
- setYScaleMinimum
mouseDragged
public void mouseDragged(MouseEvent e)
mouseMoved
public void mouseMoved(MouseEvent e)
paintChart
protected void paintChart(Graphics g,
ChartData chartData,
ChartMetrics metrics)
- Overridden by subclasses to paint type specific chart using metrics
supplied in
metrics and data supplied in chartData.
Axes, labels and legends are painted by this class.
paintComponent
public void paintComponent(Graphics g)
- Overrides:
- paintComponent in class JComponent
setColors
public void setColors(Color colors[])
- Set colors for drawing chart bars, lines, areas, and points.
Note that colors are cycled. It is not necessary to specify a
color for each row of values.
- Parameters:
- colors - Array of Color objects
setColors
public void setColors(int index,
Color colors)
- Set a single color used to draw chart bars, lines, areas, and points. The
color number is identified by specifying an index. If the index is larger than the
current number of colors, additional colors are inserted and set to gray.
- Parameters:
- index - Index of color to set
- color - Color objects
setLabelInterval
public void setLabelInterval(int interval)
- Set the interval for x axis labels.
- Parameters:
- interval - Display a label every n X axis items. For example, setting
interval to 1 displays a label for every X axis value, setting interval to
2 displays a label every 2 X axis values.
Tooltips are displayed for all X values.
- See Also:
- getLabelInterval, setLabels
setLabelList
public void setLabelList(StringList labelList)
- Set labels list property.
Labels are strings used to describe values on the chart X axis. Labels are
displayed both on the x axis and as tooltips.
This method is primarily provided for the benefit of property editors.
When wiring beans or using the API, use the alternative method
setLabels.
- Parameters:
- LabelList - Column names list encapsulated in an instance of StringList
- See Also:
- StringList, setLabelInterval, setLabels
setLabels
public void setLabels(String Labels[])
- Set labels property.
Labels are strings used to describe values on the chart X axis. Labels are
displayed both on the x axis and as tooltips.
- Parameters:
- names - Column names as array
- See Also:
- setLabelList, setLabelInterval
setLabels
public void setLabels(int index,
String Label)
- Set a single label. The label number is identified by specifying an index.
Labels are strings used to describe values on the chart X axis. Labels are
displayed both on the x axis and as tooltips.
If the index is larger than the
current number of labels, additional labels are inserted and set to blank.
- Parameters:
- index - Index of label to set
- Label - Label string
setLegendList
public void setLegendList(StringList LegendList)
- Set legends list property.
Legends are strings used to describe separate values for an X axis value.
Legends are displayed both beside the right y axis and as tooltips.
This method is primarily provided for the benefit of property editors.
When wiring beans or using the API, use the alternative method
setLegends.
- Parameters:
- LegendList - Column names list encapsulated in an instance of StringList
- See Also:
- StringList, setLegends
setLegends
public void setLegends(String legends[])
- Set legends property.
Legends are strings used to describe separate values for an X axis value.
Legends are displayed both beside the right y axis and as tooltips.
- Parameters:
- names - Column names as array
- See Also:
- setLegendList
setLegends
public void setLegends(int index,
String legend)
- Set a single legend. The legend number is identified by specifying an index.
If the index is larger than the
current number of legends, additional legends are inserted and set to blank.
- Parameters:
- index - Index of legend to set
- legend - Legend string
setShowGridLines
public void setShowGridLines(boolean show)
- Set option for displaying the grid lines in the chart
- Parameters:
- show - true-show grid false-do not show grid
setShowYAxisValues
public void setShowYAxisValues(boolean showYAxisValues)
- Set option for displaying values on Y axis
- Parameters:
- showYAxisValues - true-show values false-do not show values
setValueGrid
public void setValueGrid(DoubleGrid dg)
- Sets the values as a DoubleGrid object.
This method is provided primarily to support property editors.
When wiring beans or using the API, use the alternative method
setValues.
- Parameters:
- dg - com.ibm.eou.swingchart.DoubleGrid
- See Also:
- setValues
setValues
public void setValues(double values[][])
- Set a group of values to be displayed by the chart.
- Parameters:
- values - Group of values specified as a 2D array of doubles.
setValues
public void setValues(int rowIndex,
int columnIndex,
double value)
- Set a single value to be displayed by the chart, identified by row and column
index numbers.
If the specified row or column index is larger than the number
of rows and columns in the current values array,
the array is resized by inserting an appropriate number of
new values initialized to 0.
- Parameters:
- rowIndex - 0 based row index
- columnIndex - 0 based column index
- value - value
setYScaleAuto
public void setYScaleAuto(boolean auto)
- Set y-axis automatic scaling
- Parameters:
- auto - true:auto-scale false: set scale from maximum and minimum values
- See Also:
- setYScaleMaximum, setYScaleMinimum
setYScaleMaximum
public void setYScaleMaximum(double maximum)
- Set maximum value for y-axis scale if automatic scaling is set off.
- Parameters:
- Maximum - value
- See Also:
- setYScaleMinimum, setYScaleAuto
setYScaleMinimum
public void setYScaleMinimum(double minimum)
- Set minimum value for y-axis if automatic scaling is set off.
- Parameters:
- Minimum - value
- See Also:
- setYScaleMaximum, setYScaleAuto
All Packages Class Hierarchy This Package Previous Next Index