com.jrefinery.chart
Class VerticalXYBarRenderer
java.lang.Object
|
+--com.jrefinery.chart.AbstractRenderer
|
+--com.jrefinery.chart.AbstractXYItemRenderer
|
+--com.jrefinery.chart.VerticalXYBarRenderer
- All Implemented Interfaces:
- XYItemRenderer
- public class VerticalXYBarRenderer
- extends AbstractXYItemRenderer
- implements XYItemRenderer
A renderer that draws bars on an XY plot (requires an IntervalXYDataset).
- Author:
- DG
Method Summary |
void |
drawItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
ChartRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset data,
int series,
int item,
CrosshairInfo crosshairInfo)
Draws the visual representation of a single data item. |
void |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
ChartRenderingInfo info)
Initialises the renderer. |
void |
setMargin(double margin)
Sets the percentage amount by which the bars are trimmed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.chart.XYItemRenderer |
addPropertyChangeListener, drawDomainMarker, drawRangeMarker, getLegendItem, getPlot, getToolTipGenerator, getURLGenerator, removePropertyChangeListener, setPlot, setToolTipGenerator, setURLGenerator |
VerticalXYBarRenderer
public VerticalXYBarRenderer()
- The default constructor.
VerticalXYBarRenderer
public VerticalXYBarRenderer(double margin)
- Constructs a new renderer.
- Parameters:
margin
- the percentage amount to trim from the width of each bar.
VerticalXYBarRenderer
public VerticalXYBarRenderer(double margin,
XYToolTipGenerator toolTipGenerator)
- Constructs a new renderer.
- Parameters:
margin
- the percentage amount to trim from the width of each bar.toolTipGenerator
- the tool tip generator (null permitted).
setMargin
public void setMargin(double margin)
- Sets the percentage amount by which the bars are trimmed.
Fires a property change event.
- Parameters:
margin
- the new margin.
initialise
public void initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
ChartRenderingInfo info)
- Initialises the renderer. Here we calculate the Java2D y-coordinate for zero, since all
the bars have their bases fixed at zero.
- Specified by:
initialise
in interface XYItemRenderer
- Overrides:
initialise
in class AbstractXYItemRenderer
- Parameters:
g2
- the graphics device.dataArea
- the area inside the axes.plot
- the plot.data
- the data.info
- an optional info collection object to return data back to the caller.
drawItem
public void drawItem(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
ChartRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset data,
int series,
int item,
CrosshairInfo crosshairInfo)
- Draws the visual representation of a single data item.
- Specified by:
drawItem
in interface XYItemRenderer
- Parameters:
g2
- the graphics device.dataArea
- the area within which the plot is being drawn.info
- collects information about the drawing.plot
- the plot (can be used to obtain standard color information etc).domainAxis
- the domain axis.rangeAxis
- the range axis.data
- the dataset.series
- the series index.item
- the item index.crosshairInfo
- collects information about crosshairs.