com.jrefinery.chart
Class StackedVerticalBarRenderer
java.lang.Object
|
+--com.jrefinery.chart.AbstractRenderer
|
+--com.jrefinery.chart.AbstractCategoryItemRenderer
|
+--com.jrefinery.chart.BarRenderer
|
+--com.jrefinery.chart.VerticalBarRenderer
|
+--com.jrefinery.chart.StackedVerticalBarRenderer
- All Implemented Interfaces:
- CategoryItemRenderer
- public class StackedVerticalBarRenderer
- extends VerticalBarRenderer
A bar renderer that draws stacked bars for a vertical 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 |
hasLinkingLines()
Returns a flag to indicate whether or not there are lines between the items. |
boolean |
isStacked()
Returns true, to indicate that this renderer stacks values. |
void |
setLinkingLines(boolean status)
Sets or unsets the linking lines between items. |
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 |
StackedVerticalBarRenderer
public StackedVerticalBarRenderer()
- Constructs a renderer with a standard tool tip generator.
StackedVerticalBarRenderer
public StackedVerticalBarRenderer(CategoryToolTipGenerator toolTipGenerator)
- Constructs a renderer with a specific tool tip generator.
- Parameters:
toolTipGenerator
- the tool tip generator.
hasLinkingLines
public boolean hasLinkingLines()
- Returns a flag to indicate whether or not there are lines between the items.
- Returns:
- boolean
setLinkingLines
public void setLinkingLines(boolean status)
- Sets or unsets the linking lines between items.
- Parameters:
status
- boolean linking lines if true.
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 VerticalBarRenderer
- 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.
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 VerticalBarRenderer
- Parameters:
data
- the dataset (ignored).- Returns:
- Always
1
.
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 VerticalBarRenderer
- Returns:
- Always
false
.