com.jrefinery.chart
Class OverlaidVerticalCategoryPlot

java.lang.Object
  extended by com.jrefinery.chart.Plot
      extended by com.jrefinery.chart.CategoryPlot
          extended by com.jrefinery.chart.VerticalCategoryPlot
              extended by com.jrefinery.chart.OverlaidVerticalCategoryPlot
All Implemented Interfaces:
AxisConstants, CategoryPlotConstants, com.jrefinery.chart.event.AxisChangeListener, VerticalValuePlot, DatasetChangeListener

public class OverlaidVerticalCategoryPlot
extends VerticalCategoryPlot

An extension of VerticalCategoryPlot that allows multiple VerticalCategoryPlots to be overlaid in one space, using common axes.

Author:
Jeremy Bowman

Field Summary
protected  int seriesCount
          The total number of series.
protected  java.util.List subplots
          Storage for the subplot references.
 
Fields inherited from class com.jrefinery.chart.CategoryPlot
categoryGapsPercent, domainAxis, introGapPercent, itemGapsPercent, labelFont, labelFormatPattern, labelFormatter, labelPaint, labelsVisible, markers, parent, rangeAxis, renderer, trailGapPercent, verticalLabels
 
Fields inherited from class com.jrefinery.chart.Plot
backgroundAlpha, backgroundImage, backgroundPaint, dataset, DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, firstSeriesIndex, foregroundAlpha, insets, listeners, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, outlinePaint, outlineStroke, seriesOutlinePaint, seriesOutlineStroke, seriesPaint, seriesStroke, shapeFactory, ZERO
 
Fields inherited from interface com.jrefinery.chart.CategoryPlotConstants
DEFAULT_CATEGORY_GAPS_PERCENT, DEFAULT_INTRO_GAP_PERCENT, DEFAULT_ITEM_GAPS_PERCENT, DEFAULT_LABEL_FONT, DEFAULT_TRAIL_GAP_PERCENT, MAX_CATEGORY_GAPS_PERCENT, MAX_INTRO_GAP_PERCENT, MAX_ITEM_GAPS_PERCENT, MAX_TRAIL_GAP_PERCENT
 
Fields inherited from interface com.jrefinery.chart.AxisConstants
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE
 
Constructor Summary
OverlaidVerticalCategoryPlot(CategoryAxis domain, ValueAxis range, java.lang.Object[] categories)
          Constructs an OverlaidVerticalCategoryPlot.
OverlaidVerticalCategoryPlot(java.lang.String domainAxisLabel, java.lang.String rangeAxisLabel, java.lang.Object[] categories)
          Constructs a new overlaid vertical category plot.
 
Method Summary
 void add(VerticalCategoryPlot subplot)
          Adds a subplot.
 java.util.List getLegendItemLabels()
          Returns an array of labels to be displayed by the legend.
 java.lang.Number getMaximumVerticalDataValue()
          Returns the maximum value in the range (since the range values are plotted against the vertical axis by this plot).
 java.lang.Number getMinimumVerticalDataValue()
          Returns the minimum value in the range (since this is plotted against the vertical axis by VerticalBarPlot).
 java.lang.String getPlotType()
          Returns a short string describing the type of plot.
 int getSeriesCount()
          Returns the number of series in this plot.
 Range getVerticalDataRange()
          Returns the range of data values that will be plotted against the range axis.
 void render(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ChartRenderingInfo info, java.awt.Shape backgroundPlotArea)
          Draws a representation of the data within the dataArea region, using the current renderer.
 void setFirstSeriesIndex(int index)
          Sets the index of the first series.
 
Methods inherited from class com.jrefinery.chart.VerticalCategoryPlot
draw, getCategoryCoordinate, getCategoryDataset, getVerticalValueAxis, handleClick, isCompatibleDomainAxis, isCompatibleHorizontalAxis, isCompatibleRangeAxis, isCompatibleVerticalAxis
 
Methods inherited from class com.jrefinery.chart.CategoryPlot
addRangeMarker, datasetChanged, getCategoryGapsPercent, getDomainAxis, getIntroGapPercent, getItemGapsPercent, getLabelFont, getLabelFormatter, getLabelPaint, getLabelsVisible, getParent, getRangeAxis, getRenderer, getTrailGapPercent, getVerticalLabels, isSubplot, setCategoryGapsPercent, setDomainAxis, setIntroGapPercent, setItemGapsPercent, setLabelFont, setLabelFormatString, setLabelPaint, setLabelsVisible, setParent, setRangeAxis, setRenderer, setTrailGapPercent, setVerticalLabels, zoom
 
Methods inherited from class com.jrefinery.chart.Plot
addChangeListener, axisChanged, drawOutlineAndBackground, getBackgroundAlpha, getBackgroundPaint, getDataset, getFirstSeriesIndex, getForegroundAlpha, getInsets, getOutlinePaint, getOutlineStroke, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesStroke, getShape, getShape, getShapeFactory, notifyListeners, removeChangeListener, setBackgroundAlpha, setBackgroundImage, setBackgroundPaint, setDataset, setForegroundAlpha, setInsets, setOutlinePaint, setOutlineStroke, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesStroke, setSeriesStroke, setShapeFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subplots

protected java.util.List subplots
Storage for the subplot references.


seriesCount

protected int seriesCount
The total number of series.

Constructor Detail

OverlaidVerticalCategoryPlot

public OverlaidVerticalCategoryPlot(java.lang.String domainAxisLabel,
                                    java.lang.String rangeAxisLabel,
                                    java.lang.Object[] categories)
Constructs a new overlaid vertical category plot.

Parameters:
domainAxisLabel - The label for the domain axis.
rangeAxisLabel - The label for the range axis.
categories - The categories to be shown on the domain axis.

OverlaidVerticalCategoryPlot

public OverlaidVerticalCategoryPlot(CategoryAxis domain,
                                    ValueAxis range,
                                    java.lang.Object[] categories)
Constructs an OverlaidVerticalCategoryPlot.

Parameters:
domain - Horizontal axis to use for all sub-plots.
range - Vertical axis to use for all sub-plots.
categories - The categories to be shown on the domain axis.
Method Detail

add

public void add(VerticalCategoryPlot subplot)
Adds a subplot.

This method sets the axes of the subplot to null.

Parameters:
subplot - The subplot.

getLegendItemLabels

public java.util.List getLegendItemLabels()
Returns an array of labels to be displayed by the legend.

Overrides:
getLegendItemLabels in class CategoryPlot
Returns:
An array of legend item labels (or null).

render

public void render(java.awt.Graphics2D g2,
                   java.awt.geom.Rectangle2D dataArea,
                   ChartRenderingInfo info,
                   java.awt.Shape backgroundPlotArea)
Description copied from class: VerticalCategoryPlot
Draws a representation of the data within the dataArea region, using the current renderer.

Overrides:
render in class VerticalCategoryPlot
Parameters:
g2 - The graphics device.
dataArea - The region in which the data is to be drawn.
info - An optional object for collection dimension information.
backgroundPlotArea - The chart's background area.

getPlotType

public java.lang.String getPlotType()
Description copied from class: VerticalCategoryPlot
Returns a short string describing the type of plot.

Overrides:
getPlotType in class VerticalCategoryPlot
Returns:
A description.

getSeriesCount

public int getSeriesCount()
Description copied from class: CategoryPlot
Returns the number of series in this plot.

This gets used when the plot is part of a combined chart...there may be a better mechanism in the future.

Overrides:
getSeriesCount in class CategoryPlot
Returns:
The series count.

setFirstSeriesIndex

public void setFirstSeriesIndex(int index)
Description copied from class: Plot
Sets the index of the first series. For a single plot, this defaults to zero, but when you combine plots this will be set to a higher value to ensure that all series have a unique index (and therefore color).

Overrides:
setFirstSeriesIndex in class Plot
Parameters:
index - The new index.

getVerticalDataRange

public Range getVerticalDataRange()
Returns the range of data values that will be plotted against the range axis.

If the dataset is null, this method returns null.

Specified by:
getVerticalDataRange in interface VerticalValuePlot
Overrides:
getVerticalDataRange in class VerticalCategoryPlot
Returns:
The data range.

getMinimumVerticalDataValue

public java.lang.Number getMinimumVerticalDataValue()
Returns the minimum value in the range (since this is plotted against the vertical axis by VerticalBarPlot).

This method will return null if the dataset is null.

Overrides:
getMinimumVerticalDataValue in class VerticalCategoryPlot
Returns:
The minimum value.

getMaximumVerticalDataValue

public java.lang.Number getMaximumVerticalDataValue()
Returns the maximum value in the range (since the range values are plotted against the vertical axis by this plot).

This method will return null if the dataset is null.

Overrides:
getMaximumVerticalDataValue in class VerticalCategoryPlot
Returns:
The maximum value.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.