com.jrefinery.chart
Class VerticalBarRenderer3D
java.lang.Object
|
+--com.jrefinery.chart.AbstractRenderer
|
+--com.jrefinery.chart.AbstractCategoryItemRenderer
|
+--com.jrefinery.chart.BarRenderer
|
+--com.jrefinery.chart.VerticalBarRenderer
|
+--com.jrefinery.chart.VerticalBarRenderer3D
- All Implemented Interfaces:
- CategoryItemRenderer
- Direct Known Subclasses:
- StackedVerticalBarRenderer3D
- public class VerticalBarRenderer3D
- extends VerticalBarRenderer
A renderer for vertical bars with a 3D effect.
- Author:
- SVG
Method Summary |
int |
barWidthsPerCategory(CategoryDataset data)
This will be a method in the renderer that tells whether there is one
bar width per category or onebarwidth per series 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)
Renders an individual bar. |
void |
drawPlotBackground(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D axisDataArea,
java.awt.Shape dataClipRegion)
Draws the background for the plot. |
void |
drawRangeMarker(java.awt.Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Marker marker,
java.awt.geom.Rectangle2D axisDataArea,
java.awt.Shape dataClipRegion)
Draws a range marker. |
java.awt.geom.Rectangle2D |
getAxisArea(java.awt.geom.Rectangle2D dataArea)
Returns the area that the axes (and data) must fit into. |
java.awt.Shape |
getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
Returns the clip region... |
boolean |
hasItemGaps()
Returns true, since there are (potentially) gaps between bars in this
representation. |
Methods inherited from class com.jrefinery.chart.AbstractCategoryItemRenderer |
getCategoriesPaint, getCategoryPaint, 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 |
VerticalBarRenderer3D
public VerticalBarRenderer3D()
- Default constructor, creates a renderer with a standard tool tip
generator and a ten pixel '3D effect'.
VerticalBarRenderer3D
public VerticalBarRenderer3D(CategoryToolTipGenerator toolTipGenerator,
double effect3d)
- Constructs a new renderer with a specific tool tip generator and
'3D effect'.
- Parameters:
toolTipGenerator
- the tool tip generator.effect3d
- the size of the 3D effect (in pixels).
hasItemGaps
public boolean hasItemGaps()
- Returns true, since there are (potentially) gaps between bars in this
representation.
- Overrides:
hasItemGaps
in class VerticalBarRenderer
- Returns:
- always
true
.
barWidthsPerCategory
public int barWidthsPerCategory(CategoryDataset data)
- This will be a method in the renderer that tells whether there is one
bar width per category or onebarwidth per series per category.
- Overrides:
barWidthsPerCategory
in class VerticalBarRenderer
- Parameters:
data
- the dataset.- Returns:
- the number of bar widths per category.
getAxisArea
public java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D dataArea)
- Returns the area that the axes (and data) must fit into.
Often this is the same as the plotArea, but sometimes a smaller region
should be used (for example, the 3D charts require the axes to use less
space in order to leave room for the 'depth' part of the chart).
- Overrides:
getAxisArea
in class AbstractCategoryItemRenderer
- Parameters:
dataArea
- the full area available for the data.- Returns:
- a reduced area allowing space for the 3D effect.
getDataClipRegion
public java.awt.Shape getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
- Returns the clip region... usually returns the dataArea, but some charts
(e.g. 3D) have non rectangular clip regions.
- Overrides:
getDataClipRegion
in class AbstractCategoryItemRenderer
- Parameters:
dataArea
- the data area.- Returns:
- the clip region.
drawPlotBackground
public void drawPlotBackground(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D axisDataArea,
java.awt.Shape dataClipRegion)
- Draws the background for the plot.
For most charts, the axisDataArea and the dataClipArea are the same.
One case where they are different is the 3D-effect bar charts... here
the data clip area extends above and to the right of the axisDataArea.
- Overrides:
drawPlotBackground
in class AbstractCategoryItemRenderer
- Parameters:
g2
- the graphics device.plot
- the plot.axisDataArea
- the area inside the axes.dataClipRegion
- the data clip area.
drawRangeMarker
public void drawRangeMarker(java.awt.Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Marker marker,
java.awt.geom.Rectangle2D axisDataArea,
java.awt.Shape dataClipRegion)
- Draws a range marker.
- Overrides:
drawRangeMarker
in class VerticalBarRenderer
- Parameters:
g2
- the graphics device.plot
- the plot.axis
- the range axis.marker
- the marker.axisDataArea
- the area inside the axes.dataClipRegion
- the clipping region for the data.
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)
- Renders an individual bar.
- Overrides:
drawCategoryItem
in class VerticalBarRenderer
- Parameters:
g2
- the graphics device.dataArea
- the area for plotting the data.plot
- the plot.axis
- the range axis.data
- the dataset.series
- the series (zero-based index).category
- the category.categoryIndex
- the category index (zero-based).previousCategory
- the previous category.