| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.jfree.chart.renderer.AbstractRendererorg.jfree.chart.renderer.xy.AbstractXYItemRendererorg.jfree.chart.renderer.xy.XYBarRendererorg.jfree.chart.renderer.xy.ClusteredXYBarRendererpublic class ClusteredXYBarRendererextends XYBarRendererimplements Cloneable, PublicCloneable, SerializableXYBarRenderer that displays bars for different
series values at the same x next to each other. The assumption here is
that for each x (time or else) there is a y value for each series. If
this is not the case, there will be spaces between bars for a given x.
This renderer does not include code to calculate the crosshair point for the
plot.
Nested Class Summary |
Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.XYBarRenderer | |
XYBarRenderer.XYBarRendererState | |
Field Summary |
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer | |
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO | |
Constructor Summary | |
| |
| |
Method Summary | |
Object |
|
void |
|
boolean |
|
Range |
|
protected Range |
|
Methods inherited from class org.jfree.chart.renderer.xy.XYBarRenderer | |
clone, drawItem, drawItemLabel, equals, findDomainBounds, getBase, getGradientPaintTransformer, getLegendBar, getLegendItem, getMargin, getNegativeItemLabelPositionFallback, getPositiveItemLabelPositionFallback, getUseYInterval, initialise, isDrawBarOutline, setBase, setDrawBarOutline, setGradientPaintTransformer, setLegendBar, setMargin, setNegativeItemLabelPositionFallback, setPositiveItemLabelPositionFallback, setUseYInterval | |
public ClusteredXYBarRenderer()
Default constructor. Bar margin is set to 0.0.
public ClusteredXYBarRenderer(double margin, boolean centerBarAtStartValue)
Constructs a new XY clustered bar renderer.
- Parameters:
margin- the percentage amount to trim from the width of each bar.centerBarAtStartValue- if true, bars will be centered on the start of the time period.
public Object clone() throws CloneNotSupportedException
Returns a clone of the renderer.
- Overrides:
- clone in interface XYBarRenderer
- Returns:
- A clone.
public 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. This method is mostly copied from the superclass, the change is that in the calculated space for a singe bar we draw bars for each series next to each other. The width of each bar is the available width divided by the number of series. Bars for each series are drawn in order left to right.
- Specified by:
- drawItem in interface XYItemRenderer
- Overrides:
- drawItem in interface XYBarRenderer
- 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.item- the item index.crosshairState- crosshair information for the plot (nullpermitted).pass- the pass index.
public boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object, returningtrueifobjis aClusteredXYBarRendererwith the same settings as this renderer, andfalseotherwise.
- Overrides:
- equals in interface XYBarRenderer
- Parameters:
obj- the object (nullpermitted).
- Returns:
- A boolean.
public Range findDomainBounds(XYDataset dataset)
Returns the x-value bounds for the specified dataset.
- Specified by:
- findDomainBounds in interface XYItemRenderer
- Overrides:
- findDomainBounds in interface XYBarRenderer
- Parameters:
dataset- the dataset (nullpermitted).
- Returns:
- The bounds (possibly
null).
protected Range findDomainBoundsWithOffset(IntervalXYDataset dataset)
Iterates over the items in anIntervalXYDatasetto find the range of x-values including the interval OFFSET so that it centers the interval around the start value.
- Parameters:
dataset- the dataset (nullnot permitted).
- Returns:
- The range (possibly
null).