org.jfree.chart.renderer.xy
public class XYBarRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable
Nested Class Summary | |
---|---|
protected class | XYBarRenderer.XYBarRendererState
The state class used by this renderer. |
Constructor Summary | |
---|---|
XYBarRenderer()
The default constructor. | |
XYBarRenderer(double margin)
Constructs a new renderer.
|
Method Summary | |
---|---|
Object | clone()
Returns a clone of the renderer.
|
void | drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
Draws the visual representation of a single data item.
|
protected void | drawItemLabel(Graphics2D g2, XYDataset dataset, int series, int item, XYPlot plot, XYItemLabelGenerator generator, Rectangle2D bar, boolean negative)
Draws an item label. |
boolean | equals(Object obj)
Tests this renderer for equality with an arbitrary object.
|
Range | findDomainBounds(XYDataset dataset)
Returns the lower and upper bounds (range) of the x-values in the
specified dataset. |
double | getBase()
Returns the base value for the bars.
|
GradientPaintTransformer | getGradientPaintTransformer()
Returns the gradient paint transformer (an object used to transform
gradient paint objects to fit each bar.
|
Shape | getLegendBar()
Returns the shape used to represent bars in each legend item.
|
LegendItem | getLegendItem(int datasetIndex, int series)
Returns a default legend item for the specified series. |
double | getMargin()
Returns the margin which is a percentage amount by which the bars are
trimmed.
|
ItemLabelPosition | getNegativeItemLabelPositionFallback()
Returns the fallback position for negative item labels that don't fit
within a bar.
|
ItemLabelPosition | getPositiveItemLabelPositionFallback()
Returns the fallback position for positive item labels that don't fit
within a bar.
|
boolean | getUseYInterval()
Returns a flag that determines whether the y-interval from the dataset is
used to calculate the length of each bar.
|
XYItemRendererState | initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset dataset, PlotRenderingInfo info)
Initialises the renderer and returns a state object that should be
passed to all subsequent calls to the drawItem() method. |
boolean | isDrawBarOutline()
Returns a flag that controls whether or not bar outlines are drawn.
|
void | setBase(double base)
Sets the base value for the bars and sends a RendererChangeEvent
to all registered listeners. |
void | setDrawBarOutline(boolean draw)
Sets the flag that controls whether or not bar outlines are drawn and
sends a RendererChangeEvent to all registered listeners.
|
void | setGradientPaintTransformer(GradientPaintTransformer transformer)
Sets the gradient paint transformer and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendBar(Shape bar)
Sets the shape used to represent bars in each legend item and sends a
RendererChangeEvent to all registered listeners.
|
void | setMargin(double margin)
Sets the percentage amount by which the bars are trimmed and sends a
RendererChangeEvent to all registered listeners.
|
void | setNegativeItemLabelPositionFallback(ItemLabelPosition position)
Sets the fallback position for negative item labels that don't fit
within a bar, and sends a RendererChangeEvent to all registered
listeners.
|
void | setPositiveItemLabelPositionFallback(ItemLabelPosition position)
Sets the fallback position for positive item labels that don't fit
within a bar, and sends a RendererChangeEvent to all registered
listeners.
|
void | setUseYInterval(boolean use)
Sets the flag that determines whether the y-interval from the dataset is
used to calculate the length of each bar, and sends a
RendererChangeEvent to all registered listeners.
|
Parameters: margin the percentage amount to trim from the width of each bar.
Returns: A clone.
Throws: CloneNotSupportedException if the renderer cannot be cloned.
Parameters: g2 the graphics device. state the renderer state. 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. dataset the dataset. series the series index (zero-based). item the item index (zero-based). crosshairState crosshair information for the plot
(null
permitted). pass the pass index.
Parameters: g2 the graphics device. dataset the dataset. series the series index. item the item index. plot the plot. generator the label generator. bar the bar. negative a flag indicating a negative value.
Parameters: obj the object to test against (null
permitted).
Returns: A boolean.
Parameters: dataset the dataset (null
permitted).
Returns: The range (null
if the dataset is
null
or empty).
Returns: The base value for the bars.
See Also: XYBarRenderer
Returns: A transformer (null
possible).
See Also: setGradientPaintTransformer
Returns: The shape used to represent bars in each legend item (never
null
).
See Also: setLegendBar
Parameters: datasetIndex the dataset index (zero-based). series the series index (zero-based).
Returns: A legend item for the series.
Returns: The margin.
See Also: XYBarRenderer
Returns: The fallback position (null
possible).
Since: 1.0.2
See Also: setNegativeItemLabelPositionFallback
Returns: The fallback position (null
possible).
Since: 1.0.2
See Also: setPositiveItemLabelPositionFallback
Returns: A boolean.
See Also: XYBarRenderer
Parameters: g2 the graphics device. dataArea the area inside the axes. plot the plot. dataset the data. info an optional info collection object to return data back to the caller.
Returns: A state object.
Returns: A boolean.
See Also: XYBarRenderer
Parameters: base the new base value.
See Also: getBase getUseYInterval
Parameters: draw the flag.
See Also: isDrawBarOutline
Parameters: transformer the transformer (null
permitted).
See Also: getGradientPaintTransformer
Parameters: bar the bar shape (null
not permitted).
See Also: getLegendBar
Parameters: margin the new margin.
See Also: getMargin
Parameters: position the position (null
permitted).
Since: 1.0.2
See Also: getNegativeItemLabelPositionFallback
Parameters: position the position (null
permitted).
Since: 1.0.2
See Also: getPositiveItemLabelPositionFallback
Parameters: use the flag.
See Also: getUseYInterval