Class BarRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
org.jfree.chart.renderer.category.BarRenderer
- All Implemented Interfaces:
Serializable,Cloneable,LegendItemSource,CategoryItemRenderer,PublicCloneable
- Direct Known Subclasses:
IntervalBarRenderer,LayeredBarRenderer,StackedBarRenderer,StatisticalBarRenderer,WaterfallBarRenderer
public class BarRenderer
extends AbstractCategoryItemRenderer
implements Cloneable, PublicCloneable, Serializable
A

CategoryItemRenderer that draws individual data items as bars.
The example shown here is generated by the BarChartDemo1.java
program included in the JFreeChart Demo Collection:
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleConstant that controls the minimum width before a bar has an outline drawn.static final doubleThe default item margin percentage.Fields inherited from class org.jfree.chart.renderer.AbstractRenderer
DEFAULT_ITEM_LABEL_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double[]calculateBarL0L1(double value) Calculates the coordinates for the length of a single bar.protected doublecalculateBarW0(CategoryPlot plot, PlotOrientation orientation, Rectangle2D dataArea, CategoryAxis domainAxis, CategoryItemRendererState state, int row, int column) Calculates the coordinate of the first "side" of a bar.protected voidcalculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) Calculates the bar width and stores it in the renderer state.protected doublecalculateSeriesWidth(double space, CategoryAxis axis, int categories, int series) Calculates the available space for each series.voiddrawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) Draws the bar for a single (series, category) data item.protected voiddrawItemLabel(Graphics2D g2, CategoryDataset data, int row, int column, CategoryPlot plot, CategoryItemLabelGenerator generator, Rectangle2D bar, boolean negative) Draws an item label.booleanTests this instance for equality with an arbitrary object.findRangeBounds(CategoryDataset dataset, boolean includeInterval) Returns the range of values the renderer requires to display all the items from the specified dataset.Returns the bar painter.doublegetBase()Returns the base value for the bars.static BarPainterReturns the default bar painter.static booleanReturns the default value for theshadowsVisibleflag.Returns the gradient paint transformer (an object used to transform gradient paint objects to fit each bar).booleanReturns the flag that controls whether or not the base value for the bars is included in the range calculated byAbstractCategoryItemRenderer.findRangeBounds(CategoryDataset).doubleReturns the item margin as a percentage of the available space for all bars.getLegendItem(int datasetIndex, int series) Returns a legend item for a series.doubleReturns the lower clip value.doubleReturns the maximum bar width, as a percentage of the available drawing space.doubleReturns the minimum bar length (in Java2D units).Returns the fallback position for negative item labels that don't fit within a bar.Returns the fallback position for positive item labels that don't fit within a bar.Returns the shadow paint.booleanReturns the flag that controls whether or not shadows are drawn for the bars.doubleReturns the shadow x-offset.doubleReturns the shadow y-offset.doubleReturns the upper clip value.initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info) Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method.booleanReturns a flag that controls whether or not bar outlines are drawn.voidsetBarPainter(BarPainter painter) Sets the bar painter for this renderer and sends aRendererChangeEventto all registered listeners.voidsetBase(double base) Sets the base value for the bars and sends aRendererChangeEventto all registered listeners.static voidsetDefaultBarPainter(BarPainter painter) Sets the default bar painter.static voidsetDefaultShadowsVisible(boolean visible) Sets the default value for the shadows visible flag.voidsetDrawBarOutline(boolean draw) Sets the flag that controls whether or not bar outlines are drawn and sends aRendererChangeEventto all registered listeners.voidsetGradientPaintTransformer(GradientPaintTransformer transformer) Sets the gradient paint transformer and sends aRendererChangeEventto all registered listeners.voidsetIncludeBaseInRange(boolean include) Sets the flag that controls whether or not the base value for the bars is included in the range calculated byAbstractCategoryItemRenderer.findRangeBounds(CategoryDataset).voidsetItemMargin(double percent) Sets the item margin and sends aRendererChangeEventto all registered listeners.voidsetMaximumBarWidth(double percent) Sets the maximum bar width, which is specified as a percentage of the available space for all bars, and sends aRendererChangeEventto all registered listeners.voidsetMinimumBarLength(double min) Sets the minimum bar length and sends aRendererChangeEventto all registered listeners.voidSets the fallback position for negative item labels that don't fit within a bar, and sends aRendererChangeEventto all registered listeners.voidSets the fallback position for positive item labels that don't fit within a bar, and sends aRendererChangeEventto all registered listeners.voidsetShadowPaint(Paint paint) Sets the shadow paint and sends aRendererChangeEventto all registered listeners.voidsetShadowVisible(boolean visible) Sets the flag that controls whether or not shadows are drawn by the renderer.voidsetShadowXOffset(double offset) Sets the x-offset for the bar shadow and sends aRendererChangeEventto all registered listeners.voidsetShadowYOffset(double offset) Sets the y-offset for the bar shadow and sends aRendererChangeEventto all registered listeners.Methods inherited from class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
addEntity, addItemEntity, beginElementGroup, calculateDomainMarkerTextAnchorPoint, calculateRangeMarkerTextAnchorPoint, clone, createState, drawBackground, drawDomainGridline, drawDomainMarker, drawItemLabel, drawOutline, drawRangeLine, drawRangeMarker, findRangeBounds, getColumnCount, getDefaultItemLabelGenerator, getDefaultItemURLGenerator, getDefaultToolTipGenerator, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemMiddle, getItemURLGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, hashCode, setDefaultItemLabelGenerator, setDefaultItemLabelGenerator, setDefaultItemURLGenerator, setDefaultItemURLGenerator, setDefaultToolTipGenerator, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setSeriesToolTipGenerator, updateCrosshairValuesMethods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, endElementGroup, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getDataBoundsIncludesVisibleSeriesOnly, getDefaultCreateEntities, getDefaultEntityRadius, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultLegendShape, getDefaultLegendTextFont, getDefaultLegendTextPaint, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelInsets, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hasListener, isComputeItemLabelContrastColor, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setComputeItemLabelContrastColor, setDataBoundsIncludesVisibleSeriesOnly, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultEntityRadius, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultLegendShape, setDefaultLegendTextFont, setDefaultLegendTextPaint, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setItemLabelAnchorOffset, setItemLabelInsets, setLegendShape, setLegendTextFont, setLegendTextPaint, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setTreatLegendShapeAsLineMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.renderer.category.CategoryItemRenderer
addChangeListener, getDefaultCreateEntities, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelFont, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeChangeListener, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegendMethods inherited from interface org.jfree.chart.util.PublicCloneable
clone
-
Field Details
-
DEFAULT_ITEM_MARGIN
The default item margin percentage.- See Also:
-
BAR_OUTLINE_WIDTH_THRESHOLD
Constant that controls the minimum width before a bar has an outline drawn.- See Also:
-
-
Constructor Details
-
BarRenderer
public BarRenderer()Creates a new bar renderer with default settings.
-
-
Method Details
-
getDefaultBarPainter
Returns the default bar painter.- Returns:
- The default bar painter.
-
setDefaultBarPainter
Sets the default bar painter.- Parameters:
painter- the painter (nullnot permitted).
-
getDefaultShadowsVisible
Returns the default value for theshadowsVisibleflag.- Returns:
- A boolean.
- See Also:
-
setDefaultShadowsVisible
Sets the default value for the shadows visible flag.- Parameters:
visible- the new value for the default.- See Also:
-
getBase
Returns the base value for the bars. The default value is0.0.- Returns:
- The base value for the bars.
- See Also:
-
setBase
Sets the base value for the bars and sends aRendererChangeEventto all registered listeners.- Parameters:
base- the new base value.- See Also:
-
getItemMargin
Returns the item margin as a percentage of the available space for all bars.- Returns:
- The margin percentage (where 0.10 is ten percent).
- See Also:
-
setItemMargin
Sets the item margin and sends aRendererChangeEventto all registered listeners. The value is expressed as a percentage of the available width for plotting all the bars, with the resulting amount to be distributed between all the bars evenly.- Parameters:
percent- the margin (where 0.10 is ten percent).- See Also:
-
isDrawBarOutline
Returns a flag that controls whether or not bar outlines are drawn.- Returns:
- A boolean.
- See Also:
-
setDrawBarOutline
Sets the flag that controls whether or not bar outlines are drawn and sends aRendererChangeEventto all registered listeners.- Parameters:
draw- the flag.- See Also:
-
getMaximumBarWidth
Returns the maximum bar width, as a percentage of the available drawing space.- Returns:
- The maximum bar width.
- See Also:
-
setMaximumBarWidth
Sets the maximum bar width, which is specified as a percentage of the available space for all bars, and sends aRendererChangeEventto all registered listeners.- Parameters:
percent- the percent (where 0.05 is five percent).- See Also:
-
getMinimumBarLength
Returns the minimum bar length (in Java2D units). The default value is 0.0.- Returns:
- The minimum bar length.
- See Also:
-
setMinimumBarLength
Sets the minimum bar length and sends aRendererChangeEventto all registered listeners. The minimum bar length is specified in Java2D units, and can be used to prevent bars that represent very small data values from disappearing when drawn on the screen. Typically you would set this to (say) 0.5 or 1.0 Java 2D units. Use this attribute with caution, however, because setting it to a non-zero value will artificially increase the length of bars representing small values, which may misrepresent your data.- Parameters:
min- the minimum bar length (in Java2D units, must be >= 0.0).- See Also:
-
getGradientPaintTransformer
Returns the gradient paint transformer (an object used to transform gradient paint objects to fit each bar).- Returns:
- A transformer (
nullpossible). - See Also:
-
setGradientPaintTransformer
Sets the gradient paint transformer and sends aRendererChangeEventto all registered listeners.- Parameters:
transformer- the transformer (nullpermitted).- See Also:
-
getPositiveItemLabelPositionFallback
Returns the fallback position for positive item labels that don't fit within a bar.- Returns:
- The fallback position (
nullpossible). - See Also:
-
setPositiveItemLabelPositionFallback
Sets the fallback position for positive item labels that don't fit within a bar, and sends aRendererChangeEventto all registered listeners.- Parameters:
position- the position (nullpermitted).- See Also:
-
getNegativeItemLabelPositionFallback
Returns the fallback position for negative item labels that don't fit within a bar.- Returns:
- The fallback position (
nullpossible). - See Also:
-
setNegativeItemLabelPositionFallback
Sets the fallback position for negative item labels that don't fit within a bar, and sends aRendererChangeEventto all registered listeners.- Parameters:
position- the position (nullpermitted).- See Also:
-
getIncludeBaseInRange
Returns the flag that controls whether or not the base value for the bars is included in the range calculated byAbstractCategoryItemRenderer.findRangeBounds(CategoryDataset).- Returns:
trueif the base is included in the range, andfalseotherwise.- See Also:
-
setIncludeBaseInRange
Sets the flag that controls whether or not the base value for the bars is included in the range calculated byAbstractCategoryItemRenderer.findRangeBounds(CategoryDataset). If the flag is changed, aRendererChangeEventis sent to all registered listeners.- Parameters:
include- the new value for the flag.- See Also:
-
getBarPainter
Returns the bar painter.- Returns:
- The bar painter (never
null). - See Also:
-
setBarPainter
Sets the bar painter for this renderer and sends aRendererChangeEventto all registered listeners.- Parameters:
painter- the painter (nullnot permitted).- See Also:
-
getShadowsVisible
Returns the flag that controls whether or not shadows are drawn for the bars.- Returns:
- A boolean.
-
setShadowVisible
Sets the flag that controls whether or not shadows are drawn by the renderer.- Parameters:
visible- the new flag value.
-
getShadowPaint
Returns the shadow paint.- Returns:
- The shadow paint.
- See Also:
-
setShadowPaint
Sets the shadow paint and sends aRendererChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getShadowXOffset
Returns the shadow x-offset.- Returns:
- The shadow x-offset.
-
setShadowXOffset
Sets the x-offset for the bar shadow and sends aRendererChangeEventto all registered listeners.- Parameters:
offset- the offset.
-
getShadowYOffset
Returns the shadow y-offset.- Returns:
- The shadow y-offset.
-
setShadowYOffset
Sets the y-offset for the bar shadow and sends aRendererChangeEventto all registered listeners.- Parameters:
offset- the offset.
-
getLowerClip
Returns the lower clip value. This value is recalculated in the initialise() method.- Returns:
- The value.
-
getUpperClip
Returns the upper clip value. This value is recalculated in the initialise() method.- Returns:
- The value.
-
initialise
public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info) Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method. This method gets called once at the start of the process of drawing a chart.- Specified by:
initialisein interfaceCategoryItemRenderer- Overrides:
initialisein classAbstractCategoryItemRenderer- Parameters:
g2- the graphics device.dataArea- the area in which the data is to be plotted.plot- the plot.rendererIndex- the renderer index.info- collects chart rendering information for return to caller.- Returns:
- The renderer state.
-
calculateBarWidth
protected void calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) Calculates the bar width and stores it in the renderer state.- Parameters:
plot- the plot.dataArea- the data area.rendererIndex- the renderer index.state- the renderer state.
-
calculateBarW0
protected double calculateBarW0(CategoryPlot plot, PlotOrientation orientation, Rectangle2D dataArea, CategoryAxis domainAxis, CategoryItemRendererState state, int row, int column) Calculates the coordinate of the first "side" of a bar. This will be the minimum x-coordinate for a vertical bar, and the minimum y-coordinate for a horizontal bar.- Parameters:
plot- the plot.orientation- the plot orientation.dataArea- the data area.domainAxis- the domain axis.state- the renderer state (has the bar width precalculated).row- the row index.column- the column index.- Returns:
- The coordinate.
-
calculateBarL0L1
Calculates the coordinates for the length of a single bar.- Parameters:
value- the value represented by the bar.- Returns:
- The coordinates for each end of the bar (or
nullif the bar is not visible for the current axis range).
-
findRangeBounds
Returns the range of values the renderer requires to display all the items from the specified dataset. This takes into account the range of values in the dataset, plus the flag that determines whether or not the base value for the bars should be included in the range.- Overrides:
findRangeBoundsin classAbstractCategoryItemRenderer- Parameters:
dataset- the dataset (nullpermitted).includeInterval- include the interval if the dataset has one?- Returns:
- The range (or
nullif the dataset isnullor empty).
-
getLegendItem
Returns a legend item for a series.- Specified by:
getLegendItemin interfaceCategoryItemRenderer- Overrides:
getLegendItemin classAbstractCategoryItemRenderer- Parameters:
datasetIndex- the dataset index (zero-based).series- the series index (zero-based).- Returns:
- The legend item (possibly
null). - See Also:
-
drawItem
public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) Draws the bar for a single (series, category) data item.- Specified by:
drawItemin interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.state- the renderer state.dataArea- the data area.plot- the plot.domainAxis- the domain axis.rangeAxis- the range axis.dataset- the dataset.row- the row index (zero-based).column- the column index (zero-based).pass- the pass index.
-
calculateSeriesWidth
Calculates the available space for each series.- Parameters:
space- the space along the entire axis (in Java2D units).axis- the category axis.categories- the number of categories.series- the number of series.- Returns:
- The width of one series.
-
drawItemLabel
protected void drawItemLabel(Graphics2D g2, CategoryDataset data, int row, int column, CategoryPlot plot, CategoryItemLabelGenerator generator, Rectangle2D bar, boolean negative) Draws an item label. This method is overridden so that the bar can be used to calculate the label anchor point.- Parameters:
g2- the graphics device.data- the dataset.row- the row.column- the column.plot- the plot.generator- the label generator.bar- the bar.negative- a flag indicating a negative value.
-
equals
Tests this instance for equality with an arbitrary object.- Overrides:
equalsin classAbstractCategoryItemRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-