Class CategoryPlot
- All Implemented Interfaces:
Serializable,Cloneable,EventListener,AnnotationChangeListener,AxisChangeListener,MarkerChangeListener,RendererChangeListener,LegendItemSource,Pannable,ValueAxisPlot,Zoomable,PublicCloneable,DatasetChangeListener
- Direct Known Subclasses:
CombinedDomainCategoryPlot,CombinedRangeCategoryPlot
CategoryDataset and
renders each data item using a CategoryItemRenderer.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaintThe default crosshair paint.static final StrokeThe default crosshair stroke.static final booleanThe default crosshair visibility.static final booleanThe default visibility of the grid lines plotted against the domain axis.static final PaintThe default grid line paint.static final StrokeThe default grid line stroke.static final booleanThe default visibility of the grid lines plotted against the range axis.static final FontThe default value label font.protected static ResourceBundleThe resourceBundle for the localization.Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer) Creates a new plot. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(CategoryAnnotation annotation) Adds an annotation to the plot and sends aPlotChangeEventto all registered listeners.voidaddAnnotation(CategoryAnnotation annotation, boolean notify) Adds an annotation to the plot and, if requested, sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(int index, CategoryMarker marker, Layer layer) Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(int index, CategoryMarker marker, Layer layer, boolean notify) Adds a marker for display by a particular renderer and, if requested, sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(CategoryMarker marker) Adds a marker for display (in the foreground) against the domain axis and sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(CategoryMarker marker, Layer layer) Adds a marker for display against the domain axis and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(int index, Marker marker, Layer layer) Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(int index, Marker marker, Layer layer, boolean notify) Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(Marker marker) Adds a marker for display (in the foreground) against the range axis and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(Marker marker, Layer layer) Adds a marker for display against the range axis and sends aPlotChangeEventto all registered listeners.voidReceives notification of a change to anAnnotationadded to this plot.protected AxisSpacecalculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) Calculates the space required for the axes.protected AxisSpacecalculateDomainAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space) Calculates the space required for the domain axis/axes.protected AxisSpacecalculateRangeAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space) Calculates the space required for the range axis/axes.booleanEnsures symmetry between super/subclass implementations of equals.voidClears all the annotations and sends aPlotChangeEventto all registered listeners.voidClears the domain axes from the plot and sends aPlotChangeEventto all registered listeners.voidClears all the domain markers for the plot and sends aPlotChangeEventto all registered listeners.voidclearDomainMarkers(int index) Clears all the domain markers for the specified renderer.voidClears the range axes from the plot and sends aPlotChangeEventto all registered listeners.voidClears all the range markers for the plot and sends aPlotChangeEventto all registered listeners.voidclearRangeMarkers(int index) Clears all the range markers for the specified renderer.clone()Returns a clone of the plot.voidConfigures the domain axes.voidConfigures the range axes.voiddatasetChanged(DatasetChangeEvent event) Receives notification of a change to the plot's dataset.voiddraw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo state) Draws the plot on a Java 2D graphics device (such as the screen or a printer).protected voiddrawAnnotations(Graphics2D g2, Rectangle2D dataArea) Draws the annotations.protected MapdrawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState) A utility method for drawing the plot's axes.voiddrawBackground(Graphics2D g2, Rectangle2D area) Draws the plot background (the background color and/or image).protected voiddrawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, int datasetIndex, Comparable rowKey, Comparable columnKey, Stroke stroke, Paint paint) Draws a domain crosshair.protected voiddrawDomainGridlines(Graphics2D g2, Rectangle2D dataArea) Draws the domain gridlines for the plot, if they are visible.protected voiddrawDomainMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) Draws the domain markers (if any) for an axis and layer.protected voiddrawRangeCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) Draws a range crosshair.protected voiddrawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) Draws the range gridlines for the plot, if they are visible.protected voiddrawRangeLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint) Utility method for drawing a line perpendicular to the range axis (used for crosshairs).protected voiddrawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) Draws the range markers (if any) for an axis and layer.protected voiddrawZeroRangeBaseline(Graphics2D g2, Rectangle2D area) Draws a base line across the chart at value zero on the range axis.booleanTests the plot for equality with an arbitrary object.doubleReturns the anchor value.Returns the list of annotations.Returns the axis offset.Returns a list of the categories in the plot's primary dataset.Returns a list of the categories that should be displayed for the specified axis.Returns the order in which the columns are rendered.intReturns the dataset index for the crosshair.getDataRange(ValueAxis axis) Returns the range of data values that will be plotted against the range axis.Returns the primary dataset for the plot.getDataset(int index) Returns the dataset with the given index, ornullif there is no dataset.intReturns the number of datasets.Returns the dataset rendering order.Returns a map containing the datasets that are assigned to this plot.Returns a map containing the domain axes that are assigned to this plot.Returns the domain axis for the plot.getDomainAxis(int index) Returns a domain axis.intReturns the number of domain axes.Returns the domain axis edge.getDomainAxisEdge(int index) Returns the edge for a domain axis.getDomainAxisForDataset(int index) Returns the domain axis for a dataset.intReturns the index of the specified axis, or-1if the axis is not assigned to the plot.Returns the domain axis location for the primary domain axis.getDomainAxisLocation(int index) Returns the location for a domain axis.Returns the column key for the domain crosshair.Returns the paint used to draw the domain crosshair.Returns the row key for the domain crosshair.Returns the stroke used to draw the domain crosshair.Returns the paint used to draw grid-lines against the domain axis.Returns the position used for the domain gridlines.Returns the stroke used to draw grid-lines against the domain axis.getDomainMarkers(int index, Layer layer) Returns a collection of domain markers for a particular renderer and layer.getDomainMarkers(Layer layer) Returns the list of domain markers (read only) for the specified layer.booleanReturns the flag that controls whether or not the shared domain axis is drawn for each subplot.Returns the fixed domain axis space.Returns the fixed legend items, if any.Returns the fixed range axis space.intgetIndexOf(CategoryItemRenderer renderer) Returns the index of the specified renderer, or-1if the renderer is not assigned to this plot.Returns the legend items for the plot.Returns the orientation of the plot.Returns a string describing the type of plot.Returns a map containing the range axes that are assigned to this plot.Returns the range axis for the plot.getRangeAxis(int index) Returns a range axis.intReturns the number of range axes.Returns the edge where the primary range axis is located.getRangeAxisEdge(int index) Returns the edge for a range axis.getRangeAxisForDataset(int index) Returns the range axis for a dataset.intgetRangeAxisIndex(ValueAxis axis) Returns the index of the specified axis, or-1if the axis is not assigned to the plot.Returns the range axis location.getRangeAxisLocation(int index) Returns the location for a range axis.Returns the paint used to draw the range crosshair.Returns the pen-style (Stroke) used to draw the crosshair (if visible).doubleReturns the range crosshair value.Returns the paint used to draw the grid-lines against the range axis.Returns the stroke used to draw the grid-lines against the range axis.getRangeMarkers(int index, Layer layer) Returns a collection of range markers for a particular renderer and layer.getRangeMarkers(Layer layer) Returns the list of range markers (read only) for the specified layer.Returns the paint for the minor grid lines (if any) plotted against the range axis.Returns the stroke for the minor grid lines (if any) plotted against the range axis.Returns the paint for the zero baseline (if any) plotted against the range axis.Returns the stroke used for the zero baseline against the range axis.Returns a reference to the renderer for the plot.getRenderer(int index) Returns the renderer at the given index.intReturns the number of renderer slots for this plot.getRendererForDataset(CategoryDataset dataset) Returns the renderer for the specified dataset.Returns a map containing the renderers that are assigned to this plot.Returns the order in which the rows should be rendered.Returns the shadow generator for the plot, if any.intReturns the weight for this plot when it is used as a subplot within a combined plot.voidhandleClick(int x, int y, PlotRenderingInfo info) Handles a 'click' on the plot by updating the anchor value.inthashCode()intindexOf(CategoryDataset dataset) Returns the index of the specified dataset, or-1if the dataset does not belong to the plot.booleanReturns the flag that controls whether or not the domain crosshair is displayed by the plot.booleanReturns the flag that controls whether the domain grid-lines are visible.booleanReturnsfalsealways, because the plot cannot be panned along the domain axis/axes.booleanReturnsfalseto indicate that the domain axes are not zoomable.booleanReturns a flag indicating whether or not the crosshair should "lock-on" to actual data values.booleanReturns a flag indicating whether or not the range crosshair is visible.booleanReturns the flag that controls whether the range grid-lines are visible.booleanReturnstrueif the range axis minor grid is visible, andfalseotherwise.booleanReturnstrueif panning is enabled for the range axes, andfalseotherwise.booleanReturns a flag that controls whether or not a zero baseline is displayed for the range axis.booleanReturnstrueto indicate that the range axes are zoomable.voidmapDatasetToDomainAxes(int index, List<Integer> axisIndices) Maps the specified dataset to the axes in the list.voidmapDatasetToDomainAxis(int index, int axisIndex) Maps a dataset to a particular domain axis.voidmapDatasetToRangeAxes(int index, List<Integer> axisIndices) Maps the specified dataset to the axes in the list.voidmapDatasetToRangeAxis(int index, int axisIndex) Maps a dataset to a particular range axis.voidpanDomainAxes(double percent, PlotRenderingInfo info, Point2D source) Pans the domain axes by the specified percentage.voidpanRangeAxes(double percent, PlotRenderingInfo info, Point2D source) Pans the range axes by the specified percentage.booleanremoveAnnotation(CategoryAnnotation annotation) Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.booleanremoveAnnotation(CategoryAnnotation annotation, boolean notify) Removes an annotation from the plot and, if requested, sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(int index, Marker marker, Layer layer) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(int index, Marker marker, Layer layer, boolean notify) Removes a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(Marker marker) Removes a marker for the domain axis and sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(Marker marker, Layer layer) Removes a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(int index, Marker marker, Layer layer) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(int index, Marker marker, Layer layer, boolean notify) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(Marker marker) Removes a marker for the range axis and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(Marker marker, Layer layer) Removes a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.booleanrender(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CategoryCrosshairState crosshairState) Draws a representation of a dataset within the dataArea region using the appropriate renderer.voidReceives notification of a renderer change event.voidsetAnchorValue(double value) Sets the anchor value and sends aPlotChangeEventto all registered listeners.voidsetAnchorValue(double value, boolean notify) Sets the anchor value and, if requested, sends aPlotChangeEventto all registered listeners.voidsetAxisOffset(RectangleInsets offset) Sets the axis offsets (gap between the data area and the axes) and sends aPlotChangeEventto all registered listeners.voidsetColumnRenderingOrder(SortOrder order) Sets the column order in which the items in each dataset should be rendered and sends aPlotChangeEventto all registered listeners.voidsetCrosshairDatasetIndex(int index) Sets the dataset index for the crosshair and sends aPlotChangeEventto all registered listeners.voidsetCrosshairDatasetIndex(int index, boolean notify) Sets the dataset index for the crosshair and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDataset(int index, CategoryDataset dataset) Sets a dataset for the plot and sends a change notification to all registered listeners.voidsetDataset(CategoryDataset dataset) Sets the dataset for the plot, replacing the existing dataset, if there is one.voidSets the rendering order and sends aPlotChangeEventto all registered listeners.voidsetDomainAxes(CategoryAxis[] axes) Sets the domain axes for this plot and sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(int index, CategoryAxis axis) Sets a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(int index, CategoryAxis axis, boolean notify) Sets a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(CategoryAxis axis) Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(int index, AxisLocation location) Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(int index, AxisLocation location, boolean notify) Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location) Sets the location of the domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location, boolean notify) Sets the location of the domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidSets the column key for the domain crosshair and sends aPlotChangeEventto all registered listeners.voidsetDomainCrosshairColumnKey(Comparable key, boolean notify) Sets the column key for the domain crosshair and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDomainCrosshairPaint(Paint paint) Sets the paint used to draw the domain crosshair.voidSets the row key for the domain crosshair and sends a {PlotChangeEvent} to all registered listeners.voidsetDomainCrosshairRowKey(Comparable key, boolean notify) Sets the row key for the domain crosshair and, if requested, sends a {PlotChangeEvent} to all registered listeners.voidsetDomainCrosshairStroke(Stroke stroke) Sets the stroke used to draw the domain crosshair, and sends aPlotChangeEventto all registered listeners.voidsetDomainCrosshairVisible(boolean flag) Sets the flag that controls whether or not the domain crosshair is displayed by the plot, and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlinePaint(Paint paint) Sets the paint used to draw the grid-lines (if any) against the domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlinePosition(CategoryAnchor position) Sets the position used for the domain gridlines and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlineStroke(Stroke stroke) Sets the stroke used to draw grid-lines against the domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlinesVisible(boolean visible) Sets the flag that controls whether or not grid-lines are drawn against the domain axis.voidsetDrawSharedDomainAxis(boolean draw) Sets the flag that controls whether the shared domain axis is drawn when this plot is being used as a subplot.voidsetFixedDomainAxisSpace(AxisSpace space) Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.voidsetFixedDomainAxisSpace(AxisSpace space, boolean notify) Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.voidSets the fixed legend items for the plot.voidsetFixedRangeAxisSpace(AxisSpace space) Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.voidsetFixedRangeAxisSpace(AxisSpace space, boolean notify) Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.voidsetOrientation(PlotOrientation orientation) Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxes(ValueAxis[] axes) Sets the range axes for this plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(int index, ValueAxis axis) Sets a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(int index, ValueAxis axis, boolean notify) Sets a range axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(ValueAxis axis) Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location) Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location, boolean notify) Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location) Sets the location of the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location, boolean notify) Sets the location of the range axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairLockedOnData(boolean flag) Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values, and sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairPaint(Paint paint) Sets the paint used to draw the range crosshair (if visible) and sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairStroke(Stroke stroke) Sets the pen-style (Stroke) used to draw the range crosshair (if visible), and sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairValue(double value) Sets the range crosshair value and, if the crosshair is visible, sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairValue(double value, boolean notify) Sets the range crosshair value and, if requested, sends aPlotChangeEventto all registered listeners (but only if the crosshair is visible).voidsetRangeCrosshairVisible(boolean flag) Sets the flag indicating whether or not the range crosshair is visible.voidsetRangeGridlinePaint(Paint paint) Sets the paint used to draw the grid lines against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeGridlineStroke(Stroke stroke) Sets the stroke used to draw the grid-lines against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeGridlinesVisible(boolean visible) Sets the flag that controls whether or not grid-lines are drawn against the range axis.voidsetRangeMinorGridlinePaint(Paint paint) Sets the paint for the minor grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeMinorGridlineStroke(Stroke stroke) Sets the stroke for the minor grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRangeMinorGridlinesVisible(boolean visible) Sets the flag that controls whether or not the range axis minor grid lines are visible.voidsetRangePannable(boolean pannable) Sets the flag that enables or disables panning of the plot along the range axes.voidsetRangeZeroBaselinePaint(Paint paint) Sets the paint for the zero baseline plotted against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeZeroBaselineStroke(Stroke stroke) Sets the stroke for the zero baseline for the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRangeZeroBaselineVisible(boolean visible) Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRenderer(int index, CategoryItemRenderer renderer) Sets the renderer to use for the dataset with the specified index and sends a change event to all registered listeners.voidsetRenderer(int index, CategoryItemRenderer renderer, boolean notify) Sets the renderer to use for the dataset with the specified index and, if requested, sends a change event to all registered listeners.voidsetRenderer(CategoryItemRenderer renderer) Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a change event to all registered listeners.voidsetRenderer(CategoryItemRenderer renderer, boolean notify) Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends a change event to all registered listeners.voidsetRenderers(CategoryItemRenderer[] renderers) Sets the renderers for this plot and sends aPlotChangeEventto all registered listeners.voidsetRowRenderingOrder(SortOrder order) Sets the row order in which the items in each dataset should be rendered and sends aPlotChangeEventto all registered listeners.voidsetShadowGenerator(ShadowGenerator generator) Sets the shadow generator for the plot and sends aPlotChangeEventto all registered listeners.voidsetWeight(int weight) Sets the weight for the plot and sends aPlotChangeEventto all registered listeners.voidzoom(double percent) Zooms (in or out) on the plot's value axis.voidzoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source) This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.voidzoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source) This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.voidzoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.voidzoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source) Zooms in on the range axes.voidzoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source) Multiplies the range on the range axis/axes by the specified factor.voidzoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) Multiplies the range on the range axis/axes by the specified factor.Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, createAndAddEntity, drawBackgroundImage, drawNoDataMessage, drawOutline, fetchElementHintingFlag, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getChart, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setChart, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent
-
Field Details
-
DEFAULT_DOMAIN_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the domain axis.- See Also:
-
DEFAULT_RANGE_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the range axis.- See Also:
-
DEFAULT_GRIDLINE_STROKE
The default grid line stroke. -
DEFAULT_GRIDLINE_PAINT
The default grid line paint. -
DEFAULT_VALUE_LABEL_FONT
The default value label font. -
DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.- See Also:
-
DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke. -
DEFAULT_CROSSHAIR_PAINT
The default crosshair paint. -
localizationResources
The resourceBundle for the localization.
-
-
Constructor Details
-
CategoryPlot
public CategoryPlot()Default constructor. -
CategoryPlot
public CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer) Creates a new plot.- Parameters:
dataset- the dataset (nullpermitted).domainAxis- the domain axis (nullpermitted).rangeAxis- the range axis (nullpermitted).renderer- the item renderer (nullpermitted).
-
-
Method Details
-
getPlotType
Returns a string describing the type of plot.- Specified by:
getPlotTypein classPlot- Returns:
- The type.
-
getOrientation
Returns the orientation of the plot.- Specified by:
getOrientationin interfacePannable- Specified by:
getOrientationin interfaceZoomable- Returns:
- The orientation of the plot (never
null). - See Also:
-
setOrientation
Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
orientation- the orientation (nullnot permitted).- See Also:
-
getAxisOffset
Returns the axis offset.- Returns:
- The axis offset (never
null). - See Also:
-
setAxisOffset
Sets the axis offsets (gap between the data area and the axes) and sends aPlotChangeEventto all registered listeners.- Parameters:
offset- the offset (nullnot permitted).- See Also:
-
getDomainAxis
Returns the domain axis for the plot. If the domain axis for this plot isnull, then the method will return the parent plot's domain axis (if there is a parent plot).- Returns:
- The domain axis (
nullpermitted). - See Also:
-
getDomainAxis
Returns a domain axis.- Parameters:
index- the axis index.- Returns:
- The axis (
nullpossible). - See Also:
-
getDomainAxes
Returns a map containing the domain axes that are assigned to this plot. The map is unmodifiable.- Returns:
- A map containing the domain axes that are assigned to the plot
(never
null). - Since:
- 1.5.4
-
setDomainAxis
Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the axis (nullpermitted).- See Also:
-
setDomainAxis
Sets a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis (nullpermitted).- See Also:
-
setDomainAxis
Sets a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis (nullpermitted).notify- notify listeners?
-
setDomainAxes
Sets the domain axes for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axes- the axes (nullnot permitted).- See Also:
-
getDomainAxisIndex
Returns the index of the specified axis, or-1if the axis is not assigned to the plot.- Parameters:
axis- the axis (nullnot permitted).- Returns:
- The axis index.
- See Also:
-
getDomainAxisLocation
Returns the domain axis location for the primary domain axis.- Returns:
- The location (never
null). - See Also:
-
getDomainAxisLocation
Returns the location for a domain axis.- Parameters:
index- the axis index.- Returns:
- The location.
- See Also:
-
setDomainAxisLocation
Sets the location of the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the axis location (nullnot permitted).- See Also:
-
setDomainAxisLocation
Sets the location of the domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
location- the axis location (nullnot permitted).notify- a flag that controls whether listeners are notified.
-
setDomainAxisLocation
Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.- See Also:
-
setDomainAxisLocation
Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.notify- notify listeners?- See Also:
-
getDomainAxisEdge
Returns the domain axis edge. This is derived from the axis location and the plot orientation.- Returns:
- The edge (never
null).
-
getDomainAxisEdge
Returns the edge for a domain axis.- Parameters:
index- the axis index.- Returns:
- The edge (never
null).
-
getDomainAxisCount
Returns the number of domain axes.- Returns:
- The axis count.
-
clearDomainAxes
Clears the domain axes from the plot and sends aPlotChangeEventto all registered listeners. -
configureDomainAxes
Configures the domain axes. -
getRangeAxis
Returns the range axis for the plot. If the range axis for this plot is null, then the method will return the parent plot's range axis (if there is a parent plot).- Returns:
- The range axis (possibly
null).
-
getRangeAxis
Returns a range axis.- Parameters:
index- the axis index.- Returns:
- The axis (
nullpossible).
-
getRangeAxes
Returns a map containing the range axes that are assigned to this plot. The map is unmodifiable.- Returns:
- A map containing the domain axes that are assigned to the plot
(never
null). - Since:
- 1.5.4
-
setRangeAxis
Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the axis (nullpermitted).
-
setRangeAxis
Sets a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis.
-
setRangeAxis
Sets a range axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis.notify- notify listeners?
-
setRangeAxes
Sets the range axes for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axes- the axes (nullnot permitted).- See Also:
-
getRangeAxisIndex
Returns the index of the specified axis, or-1if the axis is not assigned to the plot.- Parameters:
axis- the axis (nullnot permitted).- Returns:
- The axis index.
- See Also:
-
getRangeAxisLocation
Returns the range axis location.- Returns:
- The location (never
null).
-
getRangeAxisLocation
Returns the location for a range axis.- Parameters:
index- the axis index.- Returns:
- The location.
- See Also:
-
setRangeAxisLocation
Sets the location of the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).- See Also:
-
setRangeAxisLocation
Sets the location of the range axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).notify- notify listeners?- See Also:
-
setRangeAxisLocation
Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.- See Also:
-
setRangeAxisLocation
Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location.notify- notify listeners?- See Also:
-
getRangeAxisEdge
Returns the edge where the primary range axis is located.- Returns:
- The edge (never
null).
-
getRangeAxisEdge
Returns the edge for a range axis.- Parameters:
index- the axis index.- Returns:
- The edge.
-
getRangeAxisCount
Returns the number of range axes.- Returns:
- The axis count.
-
clearRangeAxes
Clears the range axes from the plot and sends aPlotChangeEventto all registered listeners. -
configureRangeAxes
Configures the range axes. -
getDataset
Returns the primary dataset for the plot.- Returns:
- The primary dataset (possibly
null). - See Also:
-
getDataset
Returns the dataset with the given index, ornullif there is no dataset.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The dataset (possibly
null). - See Also:
-
getDatasets
Returns a map containing the datasets that are assigned to this plot. The map is unmodifiable.- Returns:
- A map containing the datasets that are assigned to the plot
(never
null). - Since:
- 1.5.4
-
setDataset
Sets the dataset for the plot, replacing the existing dataset, if there is one. This method also calls thedatasetChanged(DatasetChangeEvent)method, which adjusts the axis ranges if necessary and sends aPlotChangeEventto all registered listeners.- Parameters:
dataset- the dataset (nullpermitted).- See Also:
-
setDataset
Sets a dataset for the plot and sends a change notification to all registered listeners.- Parameters:
index- the dataset index (must be >= 0).dataset- the dataset (nullpermitted).- See Also:
-
getDatasetCount
Returns the number of datasets.- Returns:
- The number of datasets.
-
indexOf
Returns the index of the specified dataset, or-1if the dataset does not belong to the plot.- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The index.
-
mapDatasetToDomainAxis
Maps a dataset to a particular domain axis.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index (zero-based).- See Also:
-
mapDatasetToDomainAxes
Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.- Parameters:
index- the dataset index (zero-based).axisIndices- the axis indices (nullpermitted).
-
getDomainAxisForDataset
Returns the domain axis for a dataset. You can change the axis for a dataset using themapDatasetToDomainAxis(int, int)method.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The domain axis.
- See Also:
-
mapDatasetToRangeAxis
Maps a dataset to a particular range axis.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index (zero-based).- See Also:
-
mapDatasetToRangeAxes
Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.- Parameters:
index- the dataset index (zero-based).axisIndices- the axis indices (nullpermitted).
-
getRangeAxisForDataset
Returns the range axis for a dataset. You can change the axis for a dataset using themapDatasetToRangeAxis(int, int)method.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The range axis.
- See Also:
-
getRendererCount
Returns the number of renderer slots for this plot.- Returns:
- The number of renderer slots.
-
getRenderer
Returns a reference to the renderer for the plot.- Returns:
- The renderer.
- See Also:
-
getRenderer
Returns the renderer at the given index.- Parameters:
index- the renderer index.- Returns:
- The renderer (possibly
null). - See Also:
-
getRenderers
Returns a map containing the renderers that are assigned to this plot. The map is unmodifiable.- Returns:
- A map containing the renderers that are assigned to the plot
(never
null). - Since:
- 1.5.4
-
setRenderer
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a change event to all registered listeners.- Parameters:
renderer- the renderer (nullpermitted.- See Also:
-
setRenderer
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends a change event to all registered listeners.You can set the renderer to
null, but this is not recommended because:- no data will be displayed;
- the plot background will not be painted;
- Parameters:
renderer- the renderer (nullpermitted).notify- notify listeners?- See Also:
-
setRenderer
Sets the renderer to use for the dataset with the specified index and sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.- Parameters:
index- the index.renderer- the renderer (nullpermitted).- See Also:
-
setRenderer
Sets the renderer to use for the dataset with the specified index and, if requested, sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.- Parameters:
index- the index.renderer- the renderer (nullpermitted).notify- notify listeners?- See Also:
-
setRenderers
Sets the renderers for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
renderers- the renderers.
-
getRendererForDataset
Returns the renderer for the specified dataset. If the dataset doesn't belong to the plot, this method will returnnull.- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The renderer (possibly
null).
-
getIndexOf
Returns the index of the specified renderer, or-1if the renderer is not assigned to this plot.- Parameters:
renderer- the renderer (nullpermitted).- Returns:
- The renderer index.
-
getDatasetRenderingOrder
Returns the dataset rendering order.- Returns:
- The order (never
null). - See Also:
-
setDatasetRenderingOrder
Sets the rendering order and sends aPlotChangeEventto all registered listeners. By default, the plot renders the primary dataset last (so that the primary dataset overlays the secondary datasets). You can reverse this if you want to.- Parameters:
order- the rendering order (nullnot permitted).- See Also:
-
getColumnRenderingOrder
Returns the order in which the columns are rendered. The default value isSortOrder.ASCENDING.- Returns:
- The column rendering order (never
null). - See Also:
-
setColumnRenderingOrder
Sets the column order in which the items in each dataset should be rendered and sends aPlotChangeEventto all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.- Parameters:
order- the order (nullnot permitted).- See Also:
-
getRowRenderingOrder
Returns the order in which the rows should be rendered. The default value isSortOrder.ASCENDING.- Returns:
- The order (never
null). - See Also:
-
setRowRenderingOrder
Sets the row order in which the items in each dataset should be rendered and sends aPlotChangeEventto all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.- Parameters:
order- the order (nullnot permitted).- See Also:
-
isDomainGridlinesVisible
Returns the flag that controls whether the domain grid-lines are visible.- Returns:
- The
trueorfalse. - See Also:
-
setDomainGridlinesVisible
Sets the flag that controls whether or not grid-lines are drawn against the domain axis.If the flag value changes, a
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getDomainGridlinePosition
Returns the position used for the domain gridlines.- Returns:
- The gridline position (never
null). - See Also:
-
setDomainGridlinePosition
Sets the position used for the domain gridlines and sends aPlotChangeEventto all registered listeners.- Parameters:
position- the position (nullnot permitted).- See Also:
-
getDomainGridlineStroke
Returns the stroke used to draw grid-lines against the domain axis.- Returns:
- The stroke (never
null). - See Also:
-
setDomainGridlineStroke
Sets the stroke used to draw grid-lines against the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getDomainGridlinePaint
Returns the paint used to draw grid-lines against the domain axis.- Returns:
- The paint (never
null). - See Also:
-
setDomainGridlinePaint
Sets the paint used to draw the grid-lines (if any) against the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isRangeZeroBaselineVisible
Returns a flag that controls whether or not a zero baseline is displayed for the range axis.- Returns:
- A boolean.
- See Also:
-
setRangeZeroBaselineVisible
Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
-
getRangeZeroBaselineStroke
Returns the stroke used for the zero baseline against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeZeroBaselineStroke
Sets the stroke for the zero baseline for the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeZeroBaselinePaint
Returns the paint for the zero baseline (if any) plotted against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeZeroBaselinePaint
Sets the paint for the zero baseline plotted against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isRangeGridlinesVisible
Returns the flag that controls whether the range grid-lines are visible.- Returns:
- The flag.
- See Also:
-
setRangeGridlinesVisible
Sets the flag that controls whether or not grid-lines are drawn against the range axis. If the flag changes value, aPlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getRangeGridlineStroke
Returns the stroke used to draw the grid-lines against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeGridlineStroke
Sets the stroke used to draw the grid-lines against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeGridlinePaint
Returns the paint used to draw the grid-lines against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeGridlinePaint
Sets the paint used to draw the grid lines against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isRangeMinorGridlinesVisible
Returnstrueif the range axis minor grid is visible, andfalseotherwise.- Returns:
- A boolean.
- See Also:
-
setRangeMinorGridlinesVisible
Sets the flag that controls whether or not the range axis minor grid lines are visible.If the flag value is changed, a
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getRangeMinorGridlineStroke
Returns the stroke for the minor grid lines (if any) plotted against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeMinorGridlineStroke
Sets the stroke for the minor grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeMinorGridlinePaint
Returns the paint for the minor grid lines (if any) plotted against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeMinorGridlinePaint
Sets the paint for the minor grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getFixedLegendItems
Returns the fixed legend items, if any.- Returns:
- The legend items (possibly
null). - See Also:
-
setFixedLegendItems
Sets the fixed legend items for the plot. Leave this set tonullif you prefer the legend items to be created automatically.- Parameters:
items- the legend items (nullpermitted).- See Also:
-
getLegendItems
Returns the legend items for the plot. By default, this method creates a legend item for each series in each of the datasets. You can change this behaviour by overriding this method.- Specified by:
getLegendItemsin interfaceLegendItemSource- Overrides:
getLegendItemsin classPlot- Returns:
- The legend items.
-
handleClick
Handles a 'click' on the plot by updating the anchor value.- Overrides:
handleClickin classPlot- Parameters:
x- x-coordinate of the click (in Java2D space).y- y-coordinate of the click (in Java2D space).info- information about the plot's dimensions.
-
zoom
Zooms (in or out) on the plot's value axis.If the value 0.0 is passed in as the zoom percent, the auto-range calculation for the axis is restored (which sets the range to include the minimum and maximum data values, thus displaying all the data).
-
annotationChanged
Receives notification of a change to anAnnotationadded to this plot.- Specified by:
annotationChangedin interfaceAnnotationChangeListener- Overrides:
annotationChangedin classPlot- Parameters:
event- information about the event (not used here).
-
datasetChanged
Receives notification of a change to the plot's dataset.The range axis bounds will be recalculated if necessary.
- Specified by:
datasetChangedin interfaceDatasetChangeListener- Overrides:
datasetChangedin classPlot- Parameters:
event- information about the event (not used here).
-
rendererChanged
Receives notification of a renderer change event.- Specified by:
rendererChangedin interfaceRendererChangeListener- Parameters:
event- the event.
-
addDomainMarker
Adds a marker for display (in the foreground) against the domain axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).- See Also:
-
addDomainMarker
Adds a marker for display against the domain axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background) (nullnot permitted).- See Also:
-
addDomainMarker
Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.
- Parameters:
index- the renderer index.marker- the marker (nullnot permitted).layer- the layer (nullnot permitted).- See Also:
-
addDomainMarker
Adds a marker for display by a particular renderer and, if requested, sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to a domain axis, however this is entirely up to the renderer.
- Parameters:
index- the renderer index.marker- the marker (nullnot permitted).layer- the layer (nullnot permitted).notify- notify listeners?- See Also:
-
clearDomainMarkers
Clears all the domain markers for the plot and sends aPlotChangeEventto all registered listeners.- See Also:
-
getDomainMarkers
Returns the list of domain markers (read only) for the specified layer.- Parameters:
layer- the layer (foreground or background).- Returns:
- The list of domain markers.
-
getDomainMarkers
Returns a collection of domain markers for a particular renderer and layer.- Parameters:
index- the renderer index.layer- the layer.- Returns:
- A collection of markers (possibly
null).
-
clearDomainMarkers
Clears all the domain markers for the specified renderer.- Parameters:
index- the renderer index.- See Also:
-
removeDomainMarker
Removes a marker for the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker.- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).notify- notify listeners?- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
addRangeMarker
Adds a marker for display (in the foreground) against the range axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).- See Also:
-
addRangeMarker
Adds a marker for display against the range axis and sends aPlotChangeEventto all registered listeners. Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background) (nullnot permitted).- See Also:
-
addRangeMarker
Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to a range axis, however this is entirely up to the renderer.
- Parameters:
index- the renderer index.marker- the marker.layer- the layer.- See Also:
-
addRangeMarker
Adds a marker for display by a particular renderer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to a range axis, however this is entirely up to the renderer.
- Parameters:
index- the renderer index.marker- the marker.layer- the layer.notify- notify listeners?- See Also:
-
clearRangeMarkers
Clears all the range markers for the plot and sends aPlotChangeEventto all registered listeners.- See Also:
-
getRangeMarkers
Returns the list of range markers (read only) for the specified layer.- Parameters:
layer- the layer (foreground or background).- Returns:
- The list of range markers.
- See Also:
-
getRangeMarkers
Returns a collection of range markers for a particular renderer and layer.- Parameters:
index- the renderer index.layer- the layer.- Returns:
- A collection of markers (possibly
null).
-
clearRangeMarkers
Clears all the range markers for the specified renderer.- Parameters:
index- the renderer index.- See Also:
-
removeRangeMarker
Removes a marker for the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker.- Returns:
- A boolean indicating whether or not the marker was actually removed.
- See Also:
-
removeRangeMarker
Removes a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
- See Also:
-
removeRangeMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
- See Also:
-
removeRangeMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).notify- notify listeners.- Returns:
- A boolean indicating whether or not the marker was actually removed.
- See Also:
-
isDomainCrosshairVisible
Returns the flag that controls whether or not the domain crosshair is displayed by the plot.- Returns:
- A boolean.
- See Also:
-
setDomainCrosshairVisible
Sets the flag that controls whether or not the domain crosshair is displayed by the plot, and sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the new flag value.- See Also:
-
getDomainCrosshairRowKey
Returns the row key for the domain crosshair.- Returns:
- The row key.
-
setDomainCrosshairRowKey
Sets the row key for the domain crosshair and sends a {PlotChangeEvent} to all registered listeners.- Parameters:
key- the key.
-
setDomainCrosshairRowKey
Sets the row key for the domain crosshair and, if requested, sends a {PlotChangeEvent} to all registered listeners.- Parameters:
key- the key.notify- notify listeners?
-
getDomainCrosshairColumnKey
Returns the column key for the domain crosshair.- Returns:
- The column key.
-
setDomainCrosshairColumnKey
Sets the column key for the domain crosshair and sends aPlotChangeEventto all registered listeners.- Parameters:
key- the key.
-
setDomainCrosshairColumnKey
Sets the column key for the domain crosshair and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
key- the key.notify- notify listeners?
-
getCrosshairDatasetIndex
Returns the dataset index for the crosshair.- Returns:
- The dataset index.
-
setCrosshairDatasetIndex
Sets the dataset index for the crosshair and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the index.
-
setCrosshairDatasetIndex
Sets the dataset index for the crosshair and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the index.notify- notify listeners?
-
getDomainCrosshairPaint
Returns the paint used to draw the domain crosshair.- Returns:
- The paint (never
null). - See Also:
-
setDomainCrosshairPaint
Sets the paint used to draw the domain crosshair.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getDomainCrosshairStroke
Returns the stroke used to draw the domain crosshair.- Returns:
- The stroke (never
null). - See Also:
-
setDomainCrosshairStroke
Sets the stroke used to draw the domain crosshair, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
isRangeCrosshairVisible
Returns a flag indicating whether or not the range crosshair is visible.- Returns:
- The flag.
- See Also:
-
setRangeCrosshairVisible
Sets the flag indicating whether or not the range crosshair is visible.- Parameters:
flag- the new value of the flag.- See Also:
-
isRangeCrosshairLockedOnData
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.- Returns:
- The flag.
- See Also:
-
setRangeCrosshairLockedOnData
Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values, and sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the flag.- See Also:
-
getRangeCrosshairValue
Returns the range crosshair value.- Returns:
- The value.
- See Also:
-
setRangeCrosshairValue
Sets the range crosshair value and, if the crosshair is visible, sends aPlotChangeEventto all registered listeners.- Parameters:
value- the new value.- See Also:
-
setRangeCrosshairValue
Sets the range crosshair value and, if requested, sends aPlotChangeEventto all registered listeners (but only if the crosshair is visible).- Parameters:
value- the new value.notify- a flag that controls whether or not listeners are notified.- See Also:
-
getRangeCrosshairStroke
Returns the pen-style (Stroke) used to draw the crosshair (if visible).- Returns:
- The crosshair stroke (never
null). - See Also:
-
setRangeCrosshairStroke
Sets the pen-style (Stroke) used to draw the range crosshair (if visible), and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the new crosshair stroke (nullnot permitted).- See Also:
-
getRangeCrosshairPaint
Returns the paint used to draw the range crosshair.- Returns:
- The paint (never
null). - See Also:
-
setRangeCrosshairPaint
Sets the paint used to draw the range crosshair (if visible) and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getAnnotations
Returns the list of annotations.- Returns:
- The list of annotations (never
null). - See Also:
-
addAnnotation
Adds an annotation to the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).- See Also:
-
addAnnotation
Adds an annotation to the plot and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).notify- notify listeners?
-
removeAnnotation
Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).- Returns:
- A boolean (indicates whether or not the annotation was removed).
- See Also:
-
removeAnnotation
Removes an annotation from the plot and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).notify- notify listeners?- Returns:
- A boolean (indicates whether or not the annotation was removed).
-
clearAnnotations
Clears all the annotations and sends aPlotChangeEventto all registered listeners. -
getShadowGenerator
Returns the shadow generator for the plot, if any.- Returns:
- The shadow generator (possibly
null).
-
setShadowGenerator
Sets the shadow generator for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).
-
calculateDomainAxisSpace
Calculates the space required for the domain axis/axes.- Parameters:
g2- the graphics device.plotArea- the plot area.space- a carrier for the result (nullpermitted).- Returns:
- The required space.
-
calculateRangeAxisSpace
Calculates the space required for the range axis/axes.- Parameters:
g2- the graphics device.plotArea- the plot area.space- a carrier for the result (nullpermitted).- Returns:
- The required space.
-
calculateAxisSpace
Calculates the space required for the axes.- Parameters:
g2- the graphics device.plotArea- the plot area.- Returns:
- The space required for the axes.
-
draw
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo state) Draws the plot on a Java 2D graphics device (such as the screen or a printer).At your option, you may supply an instance of
PlotRenderingInfo. If you do, it will be populated with information about the drawing, including various plot dimensions and tooltip info.- Specified by:
drawin classPlot- Parameters:
g2- the graphics device.area- the area within which the plot (including axes) should be drawn.anchor- the anchor point (nullpermitted).parentState- the state from the parent plot, if there is one.state- collects info as the chart is drawn (possiblynull).
-
drawBackground
Draws the plot background (the background color and/or image).This method will be called during the chart drawing process and is declared public so that it can be accessed by the renderers used by certain subclasses. You shouldn't need to call this method directly.
- Overrides:
drawBackgroundin classPlot- Parameters:
g2- the graphics device.area- the area within which the plot should be drawn.
-
drawAxes
protected Map drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState) A utility method for drawing the plot's axes.- Parameters:
g2- the graphics device.plotArea- the plot area.dataArea- the data area.plotState- collects information about the plot (nullpermitted).- Returns:
- A map containing the axis states.
-
render
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CategoryCrosshairState crosshairState) Draws a representation of a dataset within the dataArea region using the appropriate renderer.- Parameters:
g2- the graphics device.dataArea- the region in which the data is to be drawn.index- the dataset and renderer index.info- an optional object for collection dimension information.crosshairState- a state object for tracking crosshair info (nullpermitted).- Returns:
- A boolean that indicates whether or not real data was found.
-
drawDomainGridlines
Draws the domain gridlines for the plot, if they are visible.- Parameters:
g2- the graphics device.dataArea- the area inside the axes.- See Also:
-
drawRangeGridlines
Draws the range gridlines for the plot, if they are visible.- Parameters:
g2- the graphics device (nullnot permitted).dataArea- the area inside the axes (nullnot permitted).ticks- the ticks.- See Also:
-
drawZeroRangeBaseline
Draws a base line across the chart at value zero on the range axis.- Parameters:
g2- the graphics device.area- the data area.- See Also:
-
drawAnnotations
Draws the annotations.- Parameters:
g2- the graphics device.dataArea- the data area.
-
drawDomainMarkers
Draws the domain markers (if any) for an axis and layer. This method is typically called from within the draw() method.- Parameters:
g2- the graphics device.dataArea- the data area.index- the renderer index.layer- the layer (foreground or background).- See Also:
-
drawRangeMarkers
Draws the range markers (if any) for an axis and layer. This method is typically called from within the draw() method.- Parameters:
g2- the graphics device.dataArea- the data area.index- the renderer index.layer- the layer (foreground or background).- See Also:
-
drawRangeLine
protected void drawRangeLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint) Utility method for drawing a line perpendicular to the range axis (used for crosshairs).- Parameters:
g2- the graphics device.dataArea- the area defined by the axes.value- the data value.stroke- the line stroke (nullnot permitted).paint- the line paint (nullnot permitted).
-
drawDomainCrosshair
protected void drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, int datasetIndex, Comparable rowKey, Comparable columnKey, Stroke stroke, Paint paint) Draws a domain crosshair.- Parameters:
g2- the graphics target.dataArea- the data area.orientation- the plot orientation.datasetIndex- the dataset index.rowKey- the row key.columnKey- the column key.stroke- the stroke used to draw the crosshair line.paint- the paint used to draw the crosshair line.- See Also:
-
drawRangeCrosshair
protected void drawRangeCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) Draws a range crosshair.- Parameters:
g2- the graphics target.dataArea- the data area.orientation- the plot orientation.value- the crosshair value.axis- the axis against which the value is measured.stroke- the stroke used to draw the crosshair line.paint- the paint used to draw the crosshair line.- See Also:
-
getDataRange
Returns the range of data values that will be plotted against the range axis. If the dataset isnull, this method returnsnull.- Specified by:
getDataRangein interfaceValueAxisPlot- Parameters:
axis- the axis.- Returns:
- The data range.
-
getWeight
Returns the weight for this plot when it is used as a subplot within a combined plot.- Returns:
- The weight.
- See Also:
-
setWeight
Sets the weight for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
weight- the weight.- See Also:
-
getFixedDomainAxisSpace
Returns the fixed domain axis space.- Returns:
- The fixed domain axis space (possibly
null). - See Also:
-
setFixedDomainAxisSpace
Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).- See Also:
-
setFixedDomainAxisSpace
Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).notify- notify listeners?- See Also:
-
getFixedRangeAxisSpace
Returns the fixed range axis space.- Returns:
- The fixed range axis space (possibly
null). - See Also:
-
setFixedRangeAxisSpace
Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).- See Also:
-
setFixedRangeAxisSpace
Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).notify- notify listeners?- See Also:
-
getCategories
Returns a list of the categories in the plot's primary dataset.- Returns:
- A list of the categories in the plot's primary dataset.
- See Also:
-
getCategoriesForAxis
Returns a list of the categories that should be displayed for the specified axis.- Parameters:
axis- the axis (nullnot permitted)- Returns:
- The categories.
-
isDomainPannable
Returnsfalsealways, because the plot cannot be panned along the domain axis/axes.- Specified by:
isDomainPannablein interfacePannable- Returns:
- A boolean.
- See Also:
-
isRangePannable
Returnstrueif panning is enabled for the range axes, andfalseotherwise.- Specified by:
isRangePannablein interfacePannable- Returns:
- A boolean.
- See Also:
-
setRangePannable
Sets the flag that enables or disables panning of the plot along the range axes.- Parameters:
pannable- the new flag value.- See Also:
-
panDomainAxes
Pans the domain axes by the specified percentage.- Specified by:
panDomainAxesin interfacePannable- Parameters:
percent- the distance to pan (as a percentage of the axis length).info- the plot infosource- the source point where the pan action started.
-
panRangeAxes
Pans the range axes by the specified percentage.- Specified by:
panRangeAxesin interfacePannable- Parameters:
percent- the distance to pan (as a percentage of the axis length).info- the plot infosource- the source point where the pan action started.
-
isDomainZoomable
Returnsfalseto indicate that the domain axes are not zoomable.- Specified by:
isDomainZoomablein interfaceZoomable- Returns:
- A boolean.
- See Also:
-
isRangeZoomable
Returnstrueto indicate that the range axes are zoomable.- Specified by:
isRangeZoomablein interfaceZoomable- Returns:
- A boolean.
- See Also:
-
zoomDomainAxes
This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
factor- the zoom factor.state- the plot state.source- the source point (in Java2D space) for the zoom.- See Also:
-
zoomDomainAxes
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source) This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
lowerPercent- the lower bound.upperPercent- the upper bound.state- the plot state.source- the source point (in Java2D space) for the zoom.- See Also:
-
zoomDomainAxes
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) This method does nothing, becauseCategoryPlotdoesn't support zooming on the domain.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point (in Java2D space).useAnchor- use source point as zoom anchor?- See Also:
-
zoomRangeAxes
Multiplies the range on the range axis/axes by the specified factor.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
factor- the zoom factor.state- the plot state.source- the source point (in Java2D space) for the zoom.- See Also:
-
zoomRangeAxes
Multiplies the range on the range axis/axes by the specified factor.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point.useAnchor- a flag that controls whether or not the source point is used for the zoom anchor.- See Also:
-
zoomRangeAxes
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source) Zooms in on the range axes.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
lowerPercent- the lower bound.upperPercent- the upper bound.state- the plot state.source- the source point (in Java2D space) for the zoom.- See Also:
-
getAnchorValue
Returns the anchor value.- Returns:
- The anchor value.
- See Also:
-
setAnchorValue
Sets the anchor value and sends aPlotChangeEventto all registered listeners.- Parameters:
value- the anchor value.- See Also:
-
setAnchorValue
Sets the anchor value and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
value- the value.notify- notify listeners?- See Also:
-
equals
Tests the plot for equality with an arbitrary object. -
canEqual
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance. -
hashCode
-
clone
Returns a clone of the plot.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classPlot- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if the cloning is not supported.
-