| org.jfree.chart.renderer.category.AbstractCategoryItemRenderer org.jfree.chart.renderer.category.BarRenderer
All known Subclasses: org.jfree.chart.renderer.category.IntervalBarRenderer, org.jfree.chart.renderer.category.WaterfallBarRenderer, org.jfree.chart.renderer.category.BarRenderer3D, org.jfree.chart.renderer.category.StackedBarRenderer, org.jfree.chart.renderer.category.StatisticalBarRenderer, org.jfree.chart.renderer.category.LayeredBarRenderer,
Constructor Summary | |
public | BarRenderer() Creates a new bar renderer with default settings. |
Method Summary | |
protected double[] | calculateBarL0L1(double value) Calculates the coordinates for the length of a single bar.
Parameters: value - the value represented by the bar. | 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. | protected void | calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state) Calculates the bar width and stores it in the renderer state. | protected double | calculateSeriesWidth(double space, CategoryAxis axis, int categories, int series) Calculates the available space for each series.
Parameters: space - the space along the entire axis (in Java2D units). Parameters: axis - the category axis. Parameters: categories - the number of categories. Parameters: series - the number of series. | 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. | protected void | drawItemLabel(Graphics2D g2, CategoryDataset data, int row, int column, CategoryPlot plot, CategoryItemLabelGenerator generator, Rectangle2D bar, boolean negative) Draws an item label. | public boolean | equals(Object obj) Tests this instance for equality with an arbitrary object.
Parameters: obj - the object (null permitted). | public Range | findRangeBounds(CategoryDataset dataset) Returns the range of values the renderer requires to display all the
items from the specified dataset. | public double | getBase() Returns the base value for the bars. | public GradientPaintTransformer | getGradientPaintTransformer() Returns the gradient paint transformer (an object used to transform
gradient paint objects to fit each bar). | public boolean | getIncludeBaseInRange() Returns the flag that controls whether or not the base value for the
bars is included in the range calculated by
BarRenderer.findRangeBounds(CategoryDataset) . | public double | getItemMargin() Returns the item margin as a percentage of the available space for all
bars. | public LegendItem | getLegendItem(int datasetIndex, int series) Returns a legend item for a series.
Parameters: datasetIndex - the dataset index (zero-based). Parameters: series - the series index (zero-based). | public double | getLowerClip() Returns the lower clip value. | public double | getMaximumBarWidth() Returns the maximum bar width, as a percentage of the available drawing
space. | public double | getMinimumBarLength() Returns the minimum bar length (in Java2D units). | public ItemLabelPosition | getNegativeItemLabelPositionFallback() Returns the fallback position for negative item labels that don't fit
within a bar. | public ItemLabelPosition | getPositiveItemLabelPositionFallback() Returns the fallback position for positive item labels that don't fit
within a bar. | public double | getUpperClip() Returns the upper clip value. | 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. | public boolean | isDrawBarOutline() Returns a flag that controls whether or not bar outlines are drawn. | public void | setBase(double base) Sets the base value for the bars and sends a
RendererChangeEvent to all registered listeners. | public void | setDrawBarOutline(boolean draw) Sets the flag that controls whether or not bar outlines are drawn and
sends a
RendererChangeEvent to all registered listeners. | public void | setGradientPaintTransformer(GradientPaintTransformer transformer) Sets the gradient paint transformer and sends a
RendererChangeEvent to all registered listeners. | public void | setIncludeBaseInRange(boolean include) Sets the flag that controls whether or not the base value for the bars
is included in the range calculated by
BarRenderer.findRangeBounds(CategoryDataset) . | public void | setItemMargin(double percent) Sets the item margin and sends a
RendererChangeEvent to all
registered listeners. | public void | setMaximumBarWidth(double percent) Sets the maximum bar width, which is specified as a percentage of the
available space for all bars, and sends a
RendererChangeEvent to
all registered listeners. | public void | setMinimumBarLength(double min) Sets the minimum bar length and sends a
RendererChangeEvent to
all registered listeners. | public 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. | public 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. |
BAR_OUTLINE_WIDTH_THRESHOLD | final public static double BAR_OUTLINE_WIDTH_THRESHOLD(Code) | | Constant that controls the minimum width before a bar has an outline
drawn.
|
DEFAULT_ITEM_MARGIN | final public static double DEFAULT_ITEM_MARGIN(Code) | | The default item margin percentage.
|
BarRenderer | public BarRenderer()(Code) | | Creates a new bar renderer with default settings.
|
calculateBarL0L1 | protected double[] calculateBarL0L1(double value)(Code) | | Calculates the coordinates for the length of a single bar.
Parameters: value - the value represented by the bar. The coordinates for each end of the bar (or null if the bar is not visible for the current axis range). |
calculateBarW0 | protected double calculateBarW0(CategoryPlot plot, PlotOrientation orientation, Rectangle2D dataArea, CategoryAxis domainAxis, CategoryItemRendererState state, int row, int column)(Code) | | 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. Parameters: orientation - the plot orientation. Parameters: dataArea - the data area. Parameters: domainAxis - the domain axis. Parameters: state - the renderer state (has the bar width precalculated). Parameters: row - the row index. Parameters: column - the column index. The coordinate. |
calculateBarWidth | protected void calculateBarWidth(CategoryPlot plot, Rectangle2D dataArea, int rendererIndex, CategoryItemRendererState state)(Code) | | Calculates the bar width and stores it in the renderer state.
Parameters: plot - the plot. Parameters: dataArea - the data area. Parameters: rendererIndex - the renderer index. Parameters: state - the renderer state. |
calculateSeriesWidth | protected double calculateSeriesWidth(double space, CategoryAxis axis, int categories, int series)(Code) | | Calculates the available space for each series.
Parameters: space - the space along the entire axis (in Java2D units). Parameters: axis - the category axis. Parameters: categories - the number of categories. Parameters: series - the number of series. The width of one series. |
drawItem | public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)(Code) | | Draws the bar for a single (series, category) data item.
Parameters: g2 - the graphics device. Parameters: state - the renderer state. Parameters: dataArea - the data area. Parameters: plot - the plot. Parameters: domainAxis - the domain axis. Parameters: rangeAxis - the range axis. Parameters: dataset - the dataset. Parameters: row - the row index (zero-based). Parameters: column - the column index (zero-based). Parameters: pass - the pass index. |
drawItemLabel | protected void drawItemLabel(Graphics2D g2, CategoryDataset data, int row, int column, CategoryPlot plot, CategoryItemLabelGenerator generator, Rectangle2D bar, boolean negative)(Code) | | 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. Parameters: data - the dataset. Parameters: row - the row. Parameters: column - the column. Parameters: plot - the plot. Parameters: generator - the label generator. Parameters: bar - the bar. Parameters: negative - a flag indicating a negative value. |
equals | public boolean equals(Object obj)(Code) | | Tests this instance for equality with an arbitrary object.
Parameters: obj - the object (null permitted). A boolean. |
findRangeBounds | public Range findRangeBounds(CategoryDataset dataset)(Code) | | 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.
Parameters: dataset - the dataset (null permitted). The range (or null if the dataset is null or empty). |
getBase | public double getBase()(Code) | | Returns the base value for the bars. The default value is
0.0 .
The base value for the bars. See Also: BarRenderer.setBase(double) |
getItemMargin | public double getItemMargin()(Code) | | Returns the item margin as a percentage of the available space for all
bars.
The margin percentage (where 0.10 is ten percent). See Also: BarRenderer.setItemMargin(double) |
getLegendItem | public LegendItem getLegendItem(int datasetIndex, int series)(Code) | | Returns a legend item for a series.
Parameters: datasetIndex - the dataset index (zero-based). Parameters: series - the series index (zero-based). The legend item (possibly null ). |
getLowerClip | public double getLowerClip()(Code) | | Returns the lower clip value. This value is recalculated in the
initialise() method.
The value. |
getUpperClip | public double getUpperClip()(Code) | | Returns the upper clip value. This value is recalculated in the
initialise() method.
The value. |
initialise | public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)(Code) | | 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.
Parameters: g2 - the graphics device. Parameters: dataArea - the area in which the data is to be plotted. Parameters: plot - the plot. Parameters: rendererIndex - the renderer index. Parameters: info - collects chart rendering information for return to caller. The renderer state. |
setItemMargin | public void setItemMargin(double percent)(Code) | | Sets the item margin and sends a
RendererChangeEvent to 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: BarRenderer.getItemMargin() |
setMaximumBarWidth | public void setMaximumBarWidth(double percent)(Code) | | Sets the maximum bar width, which is specified as a percentage of the
available space for all bars, and sends a
RendererChangeEvent to
all registered listeners.
Parameters: percent - the percent (where 0.05 is five percent). See Also: BarRenderer.getMaximumBarWidth() |
setMinimumBarLength | public void setMinimumBarLength(double min)(Code) | | Sets the minimum bar length and sends a
RendererChangeEvent to
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.
Parameters: min - the minimum bar length (in Java2D units). See Also: BarRenderer.getMinimumBarLength() |
Methods inherited from org.jfree.chart.renderer.category.AbstractCategoryItemRenderer | protected void addItemEntity(EntityCollection entities, CategoryDataset dataset, int row, int column, Shape hotspot)(Code)(Java Doc) protected Point2D calculateDomainMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)(Code)(Java Doc) protected Point2D calculateRangeMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)(Code)(Java Doc) public Object clone() throws CloneNotSupportedException(Code)(Java Doc) protected CategoryItemRendererState createState(PlotRenderingInfo info)(Code)(Java Doc) public void drawBackground(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)(Code)(Java Doc) public void drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)(Code)(Java Doc) public void drawDomainMarker(Graphics2D g2, CategoryPlot plot, CategoryAxis axis, CategoryMarker marker, Rectangle2D dataArea)(Code)(Java Doc) protected void drawItemLabel(Graphics2D g2, PlotOrientation orientation, CategoryDataset dataset, int row, int column, double x, double y, boolean negative)(Code)(Java Doc) public void drawOutline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)(Code)(Java Doc) public void drawRangeGridline(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)(Code)(Java Doc) public void drawRangeMarker(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public Range findRangeBounds(CategoryDataset dataset)(Code)(Java Doc) public CategoryItemLabelGenerator getBaseItemLabelGenerator()(Code)(Java Doc) public CategoryURLGenerator getBaseItemURLGenerator()(Code)(Java Doc) public CategoryToolTipGenerator getBaseToolTipGenerator()(Code)(Java Doc) public int getColumnCount()(Code)(Java Doc) protected CategoryAxis getDomainAxis(CategoryPlot plot, int index)(Code)(Java Doc) public DrawingSupplier getDrawingSupplier()(Code)(Java Doc) public CategoryItemLabelGenerator getItemLabelGenerator(int row, int column)(Code)(Java Doc) public CategoryURLGenerator getItemURLGenerator(int row, int column)(Code)(Java Doc) public LegendItem getLegendItem(int datasetIndex, int series)(Code)(Java Doc) public CategorySeriesLabelGenerator getLegendItemLabelGenerator()(Code)(Java Doc) public CategorySeriesLabelGenerator getLegendItemToolTipGenerator()(Code)(Java Doc) public CategorySeriesLabelGenerator getLegendItemURLGenerator()(Code)(Java Doc) public LegendItemCollection getLegendItems()(Code)(Java Doc) public int getPassCount()(Code)(Java Doc) public CategoryPlot getPlot()(Code)(Java Doc) protected ValueAxis getRangeAxis(CategoryPlot plot, int index)(Code)(Java Doc) public int getRowCount()(Code)(Java Doc) public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series)(Code)(Java Doc) public CategoryURLGenerator getSeriesItemURLGenerator(int series)(Code)(Java Doc) public CategoryToolTipGenerator getSeriesToolTipGenerator(int series)(Code)(Java Doc) public CategoryToolTipGenerator getToolTipGenerator(int row, int column)(Code)(Java Doc) public CategoryToolTipGenerator getToolTipGenerator()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)(Code)(Java Doc) public void setBaseItemLabelGenerator(CategoryItemLabelGenerator generator)(Code)(Java Doc) public void setBaseItemURLGenerator(CategoryURLGenerator generator)(Code)(Java Doc) public void setBaseToolTipGenerator(CategoryToolTipGenerator generator)(Code)(Java Doc) public void setItemLabelGenerator(CategoryItemLabelGenerator generator)(Code)(Java Doc) public void setItemURLGenerator(CategoryURLGenerator generator)(Code)(Java Doc) public void setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)(Code)(Java Doc) public void setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)(Code)(Java Doc) public void setLegendItemURLGenerator(CategorySeriesLabelGenerator generator)(Code)(Java Doc) public void setPlot(CategoryPlot plot)(Code)(Java Doc) public void setSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator)(Code)(Java Doc) public void setSeriesItemURLGenerator(int series, CategoryURLGenerator generator)(Code)(Java Doc) public void setSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator)(Code)(Java Doc) public void setToolTipGenerator(CategoryToolTipGenerator generator)(Code)(Java Doc)
|
|
|