Class MinMaxCategoryRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
org.jfree.chart.renderer.category.MinMaxCategoryRenderer
- All Implemented Interfaces:
Serializable
,Cloneable
,LegendItemSource
,CategoryItemRenderer
,PublicCloneable
Renderer for drawing min max plot. This renderer draws all the series under
the same category in the same x position using

objectIcon
and
a line from the maximum value to the minimum value. For use with the
CategoryPlot
class. The example shown here is generated by
the MinMaxCategoryPlotDemo1.java
program included in the
JFreeChart Demo Collection:

- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Paint
The paint of the line between the minimum value and the maximum value.private Stroke
The stroke of the line between the minimum value and the maximum value.private int
The last category.private double
The maximum.private Icon
The icon used to indicate the maximum value.private double
The minimum.private Icon
The icon used to indicate the minimum value.private Icon
The icon used to indicate the values.private boolean
A flag indicating whether or not lines are drawn between XY points.private static final long
For serialization.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 TypeMethodDescriptionvoid
drawItem
(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass) Draw a single data item.boolean
Tests this instance for equality with an arbitrary object.Returns the paint used to draw the line between the minimum and maximum value items in each category.Returns the stroke used to draw the line between the minimum and maximum value items in each category.private Icon
Returns an icon from a shape.private Icon
Returns an icon.Returns the icon displayed for the maximum value data item within each category.Returns the icon displayed for the minimum value data item within each category.Returns the icon drawn for each data item.boolean
Gets whether or not lines are drawn between category points.private void
readObject
(ObjectInputStream stream) Provides serialization support.void
setDrawLines
(boolean draw) Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends aRendererChangeEvent
to all registered listeners.void
setGroupPaint
(Paint paint) Sets the paint used to draw the line between the minimum and maximum value items in each category and sends aRendererChangeEvent
to all registered listeners.void
setGroupStroke
(Stroke stroke) Sets the stroke of the line between the minimum value and the maximum value and sends aRendererChangeEvent
to all registered listeners.void
setMaxIcon
(Icon icon) Sets the icon displayed for the maximum value data item within each category and sends aRendererChangeEvent
to all registered listeners.void
setMinIcon
(Icon icon) Sets the icon displayed for the minimum value data item within each category and sends aRendererChangeEvent
to all registered listeners.void
setObjectIcon
(Icon icon) Sets the icon drawn for each data item and sends aRendererChangeEvent
to all registered listeners.private void
writeObject
(ObjectOutputStream stream) Provides serialization support.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, findRangeBounds, getColumnCount, getDefaultItemLabelGenerator, getDefaultItemURLGenerator, getDefaultToolTipGenerator, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemMiddle, getItemURLGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, hashCode, initialise, setDefaultItemLabelGenerator, setDefaultItemLabelGenerator, setDefaultItemURLGenerator, setDefaultItemURLGenerator, setDefaultToolTipGenerator, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setSeriesToolTipGenerator, updateCrosshairValues
Methods 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, setTreatLegendShapeAsLine
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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, setSeriesVisibleInLegend
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
plotLines
private boolean plotLinesA flag indicating whether or not lines are drawn between XY points. -
groupPaint
The paint of the line between the minimum value and the maximum value. -
groupStroke
The stroke of the line between the minimum value and the maximum value. -
minIcon
The icon used to indicate the minimum value. -
maxIcon
The icon used to indicate the maximum value. -
objectIcon
The icon used to indicate the values. -
lastCategory
private int lastCategoryThe last category. -
min
private double minThe minimum. -
max
private double maxThe maximum.
-
-
Constructor Details
-
MinMaxCategoryRenderer
public MinMaxCategoryRenderer()Default constructor.
-
-
Method Details
-
isDrawLines
public boolean isDrawLines()Gets whether or not lines are drawn between category points.- Returns:
- boolean true if line will be drawn between sequenced categories, otherwise false.
- See Also:
-
setDrawLines
public void setDrawLines(boolean draw) Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends aRendererChangeEvent
to all registered listeners.- Parameters:
draw
- the new value of the flag.- See Also:
-
getGroupPaint
Returns the paint used to draw the line between the minimum and maximum value items in each category.- Returns:
- The paint (never
null
). - See Also:
-
setGroupPaint
Sets the paint used to draw the line between the minimum and maximum value items in each category and sends aRendererChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getGroupStroke
Returns the stroke used to draw the line between the minimum and maximum value items in each category.- Returns:
- The stroke (never
null
). - See Also:
-
setGroupStroke
Sets the stroke of the line between the minimum value and the maximum value and sends aRendererChangeEvent
to all registered listeners.- Parameters:
stroke
- the new stroke (null
not permitted).
-
getObjectIcon
Returns the icon drawn for each data item.- Returns:
- The icon (never
null
). - See Also:
-
setObjectIcon
Sets the icon drawn for each data item and sends aRendererChangeEvent
to all registered listeners.- Parameters:
icon
- the icon.- See Also:
-
getMaxIcon
Returns the icon displayed for the maximum value data item within each category.- Returns:
- The icon (never
null
). - See Also:
-
setMaxIcon
Sets the icon displayed for the maximum value data item within each category and sends aRendererChangeEvent
to all registered listeners.- Parameters:
icon
- the icon (null
not permitted).- See Also:
-
getMinIcon
Returns the icon displayed for the minimum value data item within each category.- Returns:
- The icon (never
null
). - See Also:
-
setMinIcon
Sets the icon displayed for the minimum value data item within each category and sends aRendererChangeEvent
to all registered listeners.- Parameters:
icon
- the icon (null
not permitted).- 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) Draw a single data item.- Parameters:
g2
- the graphics device.state
- the renderer state.dataArea
- the area in which the data is drawn.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.
-
equals
Tests this instance for equality with an arbitrary object. The icon fields are NOT included in the test, so this implementation is a little weak.- Overrides:
equals
in classAbstractCategoryItemRenderer
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
getIcon
Returns an icon.- Parameters:
shape
- the shape.fillPaint
- the fill paint.outlinePaint
- the outline paint.- Returns:
- The icon.
-
getIcon
Returns an icon from a shape.- Parameters:
shape
- the shape.fill
- the fill flag.outline
- the outline flag.- Returns:
- The icon.
-
writeObject
Provides serialization support.- Parameters:
stream
- the output stream.- Throws:
IOException
- if there is an I/O error.
-
readObject
Provides serialization support.- Parameters:
stream
- the input stream.- Throws:
IOException
- if there is an I/O error.ClassNotFoundException
- if there is a classpath problem.
-