com.jrefinery.chart
Class StackedHorizontalBarRenderer
java.lang.Object
|
+--com.jrefinery.chart.AbstractRenderer
|
+--com.jrefinery.chart.AbstractCategoryItemRenderer
|
+--com.jrefinery.chart.BarRenderer
|
+--com.jrefinery.chart.HorizontalBarRenderer
|
+--com.jrefinery.chart.StackedHorizontalBarRenderer
- All Implemented Interfaces:
- CategoryItemRenderer
- public class StackedHorizontalBarRenderer
- extends HorizontalBarRenderer
A renderer that handles the drawing of "stacked" bars for a horizontal bar plot.
- Author:
- DG
Method Summary |
int |
barWidthsPerCategory(CategoryDataset data)
Returns the number of "bar widths" per category. |
void |
drawCategoryItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
ValueAxis axis,
CategoryDataset data,
int series,
java.lang.Object category,
int categoryIndex,
java.lang.Object previousCategory)
Draws a stacked bar for a specific item. |
boolean |
hasItemGaps()
Returns a flag (always false for this renderer) to indicate whether or
not there are gaps between items in the plot. |
boolean |
isStacked()
Returns true, to indicate that this renderer stacks values. |
Methods inherited from class com.jrefinery.chart.AbstractCategoryItemRenderer |
drawPlotBackground, getAxisArea, getCategoriesPaint, getCategoryPaint, getDataClipRegion, getLegendItem, getPlot, getToolTipGenerator, getURLGenerator, getUseCategoriesPaint, setCategoriesPaint, setPlot, setToolTipGenerator, setURLGenerator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StackedHorizontalBarRenderer
public StackedHorizontalBarRenderer()
- Constructs a renderer with a standard tool tip generator.
StackedHorizontalBarRenderer
public StackedHorizontalBarRenderer(CategoryToolTipGenerator toolTipGenerator)
- Constructs a renderer with a specific tool tip generator.
- Parameters:
toolTipGenerator
- the tool tip generator.
drawCategoryItem
public void drawCategoryItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
ValueAxis axis,
CategoryDataset data,
int series,
java.lang.Object category,
int categoryIndex,
java.lang.Object previousCategory)
- Draws a stacked bar for a specific item.
- Overrides:
drawCategoryItem
in class HorizontalBarRenderer
- Parameters:
g2
- the graphics device.dataArea
- the plot area.plot
- the plot.axis
- the range axis.data
- the data.series
- the series number (zero-based index).category
- the category.categoryIndex
- the category number (zero-based index).previousCategory
- the previous category.
isStacked
public boolean isStacked()
- Returns true, to indicate that this renderer stacks values.
This affects the axis range required to display all values.
- Overrides:
isStacked
in class BarRenderer
- Returns:
- Always true.
hasItemGaps
public boolean hasItemGaps()
- Returns a flag (always false for this renderer) to indicate whether or
not there are gaps between items in the plot.
- Overrides:
hasItemGaps
in class HorizontalBarRenderer
- Returns:
- Always
false
.
barWidthsPerCategory
public int barWidthsPerCategory(CategoryDataset data)
- Returns the number of "bar widths" per category.
For this style of rendering, there is only one bar per category.
- Overrides:
barWidthsPerCategory
in class HorizontalBarRenderer
- Parameters:
data
- the dataset (ignored).- Returns:
- Always
1
.