org.jfree.chart.plot

Class CategoryPlot

public class CategoryPlot extends Plot implements ValueAxisPlot, Zoomable, RendererChangeListener, Cloneable, PublicCloneable, Serializable

A general plotting class that uses data from a CategoryDataset and renders each data item using a CategoryItemRenderer.
Field Summary
static PaintDEFAULT_CROSSHAIR_PAINT
The default crosshair paint.
static StrokeDEFAULT_CROSSHAIR_STROKE
The default crosshair stroke.
static booleanDEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.
static booleanDEFAULT_DOMAIN_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the domain axis.
static PaintDEFAULT_GRIDLINE_PAINT
The default grid line paint.
static StrokeDEFAULT_GRIDLINE_STROKE
The default grid line stroke.
static booleanDEFAULT_RANGE_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the range axis.
static FontDEFAULT_VALUE_LABEL_FONT
The default value label font.
protected static ResourceBundlelocalizationResources
The resourceBundle for the localization.
Constructor Summary
CategoryPlot()
Default constructor.
CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)
Creates a new plot.
Method Summary
voidaddAnnotation(CategoryAnnotation annotation)
Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners.
voidaddAnnotation(CategoryAnnotation annotation, boolean notify)
Adds an annotation to the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
voidaddDomainMarker(CategoryMarker marker)
Adds a marker for display (in the foreground) against the domain axis and sends a PlotChangeEvent to all registered listeners.
voidaddDomainMarker(CategoryMarker marker, Layer layer)
Adds a marker for display against the domain axis and sends a PlotChangeEvent to all registered listeners.
voidaddDomainMarker(int index, CategoryMarker marker, Layer layer)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to 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 a PlotChangeEvent to all registered listeners.
voidaddRangeMarker(Marker marker)
Adds a marker for display (in the foreground) against the range axis and sends a PlotChangeEvent to all registered listeners.
voidaddRangeMarker(Marker marker, Layer layer)
Adds a marker for display against the range axis and sends a PlotChangeEvent to all registered listeners.
voidaddRangeMarker(int index, Marker marker, Layer layer)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to all registered listeners.
voidaddRangeMarker(int index, Marker marker, Layer layer, boolean notify)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to all registered listeners.
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.
voidclearAnnotations()
Clears all the annotations and sends a PlotChangeEvent to all registered listeners.
voidclearDomainAxes()
Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners.
voidclearDomainMarkers()
Clears all the domain markers for the plot and sends a PlotChangeEvent to all registered listeners.
voidclearDomainMarkers(int index)
Clears all the domain markers for the specified renderer.
voidclearRangeAxes()
Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners.
voidclearRangeMarkers()
Clears all the range markers for the plot and sends a PlotChangeEvent to all registered listeners.
voidclearRangeMarkers(int index)
Clears all the range markers for the specified renderer.
Objectclone()
Returns a clone of the plot.
voidconfigureDomainAxes()
Configures the domain axes.
voidconfigureRangeAxes()
Configures 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 voiddrawDomainGridlines(Graphics2D g2, Rectangle2D dataArea)
Draws the gridlines for the plot.
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 gridlines for the plot.
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.
booleanequals(Object obj)
Tests the plot for equality with an arbitrary object.
doublegetAnchorValue()
Returns the anchor value.
ListgetAnnotations()
Returns the list of annotations.
RectangleInsetsgetAxisOffset()
Returns the axis offset.
ListgetCategories()
Returns a list of the categories in the plot's primary dataset.
ListgetCategoriesForAxis(CategoryAxis axis)
Returns a list of the categories that should be displayed for the specified axis.
SortOrdergetColumnRenderingOrder()
Returns the order in which the columns are rendered.
RangegetDataRange(ValueAxis axis)
Returns the range of data values that will be plotted against the range axis.
CategoryDatasetgetDataset()
Returns the primary dataset for the plot.
CategoryDatasetgetDataset(int index)
Returns the dataset at the given index.
intgetDatasetCount()
Returns the number of datasets.
DatasetRenderingOrdergetDatasetRenderingOrder()
Returns the dataset rendering order.
CategoryAxisgetDomainAxis()
Returns the domain axis for the plot.
CategoryAxisgetDomainAxis(int index)
Returns a domain axis.
intgetDomainAxisCount()
Returns the number of domain axes.
RectangleEdgegetDomainAxisEdge()
Returns the domain axis edge.
RectangleEdgegetDomainAxisEdge(int index)
Returns the edge for a domain axis.
CategoryAxisgetDomainAxisForDataset(int index)
Returns the domain axis for a dataset.
intgetDomainAxisIndex(CategoryAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.
AxisLocationgetDomainAxisLocation()
Returns the domain axis location for the primary domain axis.
AxisLocationgetDomainAxisLocation(int index)
Returns the location for a domain axis.
PaintgetDomainGridlinePaint()
Returns the paint used to draw grid-lines against the domain axis.
CategoryAnchorgetDomainGridlinePosition()
Returns the position used for the domain gridlines.
StrokegetDomainGridlineStroke()
Returns the stroke used to draw grid-lines against the domain axis.
CollectiongetDomainMarkers(Layer layer)
Returns the list of domain markers (read only) for the specified layer.
CollectiongetDomainMarkers(int index, Layer layer)
Returns a collection of domain markers for a particular renderer and layer.
booleangetDrawSharedDomainAxis()
Returns the flag that controls whether or not the shared domain axis is drawn for each subplot.
AxisSpacegetFixedDomainAxisSpace()
Returns the fixed domain axis space.
LegendItemCollectiongetFixedLegendItems()
Returns the fixed legend items, if any.
AxisSpacegetFixedRangeAxisSpace()
Returns the fixed range axis space.
intgetIndexOf(CategoryItemRenderer renderer)
Returns the index of the specified renderer, or -1 if the renderer is not assigned to this plot.
LegendItemCollectiongetLegendItems()
Returns the legend items for the plot.
PlotOrientationgetOrientation()
Returns the orientation of the plot.
StringgetPlotType()
Returns a string describing the type of plot.
ValueAxisgetRangeAxis()
Returns the range axis for the plot.
ValueAxisgetRangeAxis(int index)
Returns a range axis.
intgetRangeAxisCount()
Returns the number of range axes.
RectangleEdgegetRangeAxisEdge()
Returns the edge where the primary range axis is located.
RectangleEdgegetRangeAxisEdge(int index)
Returns the edge for a range axis.
ValueAxisgetRangeAxisForDataset(int index)
Returns the range axis for a dataset.
intgetRangeAxisIndex(ValueAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.
AxisLocationgetRangeAxisLocation()
Returns the range axis location.
AxisLocationgetRangeAxisLocation(int index)
Returns the location for a range axis.
PaintgetRangeCrosshairPaint()
Returns the paint used to draw the range crosshair.
StrokegetRangeCrosshairStroke()
Returns the pen-style (Stroke) used to draw the crosshair (if visible).
doublegetRangeCrosshairValue()
Returns the range crosshair value.
PaintgetRangeGridlinePaint()
Returns the paint used to draw the grid-lines against the range axis.
StrokegetRangeGridlineStroke()
Returns the stroke used to draw the grid-lines against the range axis.
CollectiongetRangeMarkers(Layer layer)
Returns the list of range markers (read only) for the specified layer.
CollectiongetRangeMarkers(int index, Layer layer)
Returns a collection of range markers for a particular renderer and layer.
CategoryItemRenderergetRenderer()
Returns a reference to the renderer for the plot.
CategoryItemRenderergetRenderer(int index)
Returns the renderer at the given index.
CategoryItemRenderergetRendererForDataset(CategoryDataset dataset)
Returns the renderer for the specified dataset.
SortOrdergetRowRenderingOrder()
Returns the order in which the rows should be rendered.
intgetWeight()
Returns 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.
booleanisDomainGridlinesVisible()
Returns the flag that controls whether the domain grid-lines are visible.
booleanisDomainZoomable()
Returns false to indicate that the domain axes are not zoomable.
booleanisRangeCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
booleanisRangeCrosshairVisible()
Returns a flag indicating whether or not the range crosshair is visible.
booleanisRangeGridlinesVisible()
Returns the flag that controls whether the range grid-lines are visible.
booleanisRangeZoomable()
Returns true to indicate that the range axes are zoomable.
voidmapDatasetToDomainAxis(int index, int axisIndex)
Maps a dataset to a particular domain axis.
voidmapDatasetToRangeAxis(int index, int axisIndex)
Maps a dataset to a particular range axis.
booleanremoveAnnotation(CategoryAnnotation annotation)
Removes an annotation from the plot and sends a PlotChangeEvent to all registered listeners.
booleanremoveAnnotation(CategoryAnnotation annotation, boolean notify)
Removes an annotation from the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
booleanremoveDomainMarker(Marker marker)
Removes a marker for the domain axis and sends a PlotChangeEvent to all registered listeners.
booleanremoveDomainMarker(Marker marker, Layer layer)
Removes a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners.
booleanremoveDomainMarker(int index, Marker marker, Layer layer)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
booleanremoveDomainMarker(int index, Marker marker, Layer layer, boolean notify)
Removes a marker for a specific dataset/renderer and, if requested, sends a PlotChangeEvent to all registered listeners.
booleanremoveRangeMarker(Marker marker)
Removes a marker for the range axis and sends a PlotChangeEvent to all registered listeners.
booleanremoveRangeMarker(Marker marker, Layer layer)
Removes a marker for the range axis in the specified layer and sends a PlotChangeEvent to all registered listeners.
booleanremoveRangeMarker(int index, Marker marker, Layer layer)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
booleanremoveRangeMarker(int index, Marker marker, Layer layer, boolean notify)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to all registered listeners.
booleanrender(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info)
Draws a representation of a dataset within the dataArea region using the appropriate renderer.
voidrendererChanged(RendererChangeEvent event)
Receives notification of a renderer change event.
voidsetAnchorValue(double value)
Sets the anchor value and sends a PlotChangeEvent to all registered listeners.
voidsetAnchorValue(double value, boolean notify)
Sets the anchor value and, if requested, sends a PlotChangeEvent to all registered listeners.
voidsetAxisOffset(RectangleInsets offset)
Sets the axis offsets (gap between the data area and the axes) and sends a PlotChangeEvent to all registered listeners.
voidsetColumnRenderingOrder(SortOrder order)
Sets the column order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners.
voidsetDataset(CategoryDataset dataset)
Sets the dataset for the plot, replacing the existing dataset, if there is one.
voidsetDataset(int index, CategoryDataset dataset)
Sets a dataset for the plot.
voidsetDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxes(CategoryAxis[] axes)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxis(CategoryAxis axis)
Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxis(int index, CategoryAxis axis)
Sets a domain axis and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxis(int index, CategoryAxis axis, boolean notify)
Sets a domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxisLocation(AxisLocation location, boolean notify)
Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxisLocation(int index, AxisLocation location)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.
voidsetDomainAxisLocation(int index, AxisLocation location, boolean notify)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.
voidsetDomainGridlinePaint(Paint paint)
Sets the paint used to draw the grid-lines (if any) against the domain axis and sends a PlotChangeEvent to all registered listeners.
voidsetDomainGridlinePosition(CategoryAnchor position)
Sets the position used for the domain gridlines and sends a PlotChangeEvent to all registered listeners.
voidsetDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against the domain axis.
voidsetDomainGridlineStroke(Stroke stroke)
Sets the stroke used to draw grid-lines against the domain axis and sends a PlotChangeEvent to all registered listeners.
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 a PlotChangeEvent to all registered listeners.
voidsetFixedDomainAxisSpace(AxisSpace space, boolean notify)
Sets the fixed domain axis space and sends a PlotChangeEvent to all registered listeners.
voidsetFixedLegendItems(LegendItemCollection items)
Sets the fixed legend items for the plot.
voidsetFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.
voidsetFixedRangeAxisSpace(AxisSpace space, boolean notify)
Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.
voidsetOrientation(PlotOrientation orientation)
Sets the orientation for the plot and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxes(ValueAxis[] axes)
Sets the range axes for this plot and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxis(int index, ValueAxis axis)
Sets a range axis and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxis(int index, ValueAxis axis, boolean notify)
Sets a range axis and, if requested, sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxisLocation(AxisLocation location)
Sets the location of the range axis and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxisLocation(AxisLocation location, boolean notify)
Sets the location of the range axis and, if requested, sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxisLocation(int index, AxisLocation location)
Sets the location for a range axis and sends a PlotChangeEvent to all registered listeners.
voidsetRangeAxisLocation(int index, AxisLocation location, boolean notify)
Sets the location for a range axis and sends a PlotChangeEvent to 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 a PlotChangeEvent to all registered listeners.
voidsetRangeCrosshairPaint(Paint paint)
Sets the paint used to draw the range crosshair (if visible) and sends a PlotChangeEvent to all registered listeners.
voidsetRangeCrosshairStroke(Stroke stroke)
Sets the pen-style (Stroke) used to draw the range crosshair (if visible), and sends a PlotChangeEvent to all registered listeners.
voidsetRangeCrosshairValue(double value)
Sets the range crosshair value and, if the crosshair is visible, sends a PlotChangeEvent to all registered listeners.
voidsetRangeCrosshairValue(double value, boolean notify)
Sets the range crosshair value and, if requested, sends a PlotChangeEvent to 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 a PlotChangeEvent to all registered listeners.
voidsetRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against the range axis.
voidsetRangeGridlineStroke(Stroke stroke)
Sets the stroke used to draw the grid-lines against the range axis and sends a PlotChangeEvent to all registered listeners.
voidsetRenderer(CategoryItemRenderer renderer)
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a PlotChangeEvent 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 PlotChangeEvent to all registered listeners.
voidsetRenderer(int index, CategoryItemRenderer renderer)
Sets the renderer at the specified index and sends a PlotChangeEvent to all registered listeners.
voidsetRenderer(int index, CategoryItemRenderer renderer, boolean notify)
Sets a renderer.
voidsetRenderers(CategoryItemRenderer[] renderers)
Sets the renderers for this plot and sends a PlotChangeEvent to all registered listeners.
voidsetRowRenderingOrder(SortOrder order)
Sets the row order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners.
voidsetWeight(int weight)
Sets the weight for the plot and sends a PlotChangeEvent to all registered listeners.
voidzoom(double percent)
Zooms (in or out) on the plot's value axis.
voidzoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.
voidzoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.
voidzoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.
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.
voidzoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
Zooms in on the range axes.

Field Detail

DEFAULT_CROSSHAIR_PAINT

public static final Paint DEFAULT_CROSSHAIR_PAINT
The default crosshair paint.

Since: 1.0.5

DEFAULT_CROSSHAIR_STROKE

public static final Stroke DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke.

Since: 1.0.5

DEFAULT_CROSSHAIR_VISIBLE

public static final boolean DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.

Since: 1.0.5

DEFAULT_DOMAIN_GRIDLINES_VISIBLE

public static final boolean DEFAULT_DOMAIN_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the domain axis.

DEFAULT_GRIDLINE_PAINT

public static final Paint DEFAULT_GRIDLINE_PAINT
The default grid line paint.

DEFAULT_GRIDLINE_STROKE

public static final Stroke DEFAULT_GRIDLINE_STROKE
The default grid line stroke.

DEFAULT_RANGE_GRIDLINES_VISIBLE

public static final boolean DEFAULT_RANGE_GRIDLINES_VISIBLE
The default visibility of the grid lines plotted against the range axis.

DEFAULT_VALUE_LABEL_FONT

public static final Font DEFAULT_VALUE_LABEL_FONT
The default value label font.

localizationResources

protected static ResourceBundle localizationResources
The resourceBundle for the localization.

Constructor Detail

CategoryPlot

public CategoryPlot()
Default constructor.

CategoryPlot

public CategoryPlot(CategoryDataset dataset, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryItemRenderer renderer)
Creates a new plot.

Parameters: dataset the dataset (null permitted). domainAxis the domain axis (null permitted). rangeAxis the range axis (null permitted). renderer the item renderer (null permitted).

Method Detail

addAnnotation

public void addAnnotation(CategoryAnnotation annotation)
Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: annotation the annotation (null not permitted).

See Also: removeAnnotation

addAnnotation

public void addAnnotation(CategoryAnnotation annotation, boolean notify)
Adds an annotation to the plot and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: annotation the annotation (null not permitted). notify notify listeners?

Since: 1.0.10

addDomainMarker

public void addDomainMarker(CategoryMarker marker)
Adds a marker for display (in the foreground) against the domain axis and sends a PlotChangeEvent to 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 (null not permitted).

See Also: removeDomainMarker

addDomainMarker

public void addDomainMarker(CategoryMarker marker, Layer layer)
Adds a marker for display against the domain axis and sends a PlotChangeEvent to 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 (null not permitted). layer the layer (foreground or background) (null not permitted).

See Also: CategoryPlot

addDomainMarker

public void addDomainMarker(int index, CategoryMarker marker, Layer layer)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to 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 (null not permitted). layer the layer (null not permitted).

See Also: CategoryPlot

addDomainMarker

public void addDomainMarker(int index, CategoryMarker marker, Layer layer, boolean notify)
Adds a marker for display by a particular renderer and, if requested, sends a PlotChangeEvent to 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 (null not permitted). layer the layer (null not permitted). notify notify listeners?

Since: 1.0.10

See Also: CategoryPlot

addRangeMarker

public void addRangeMarker(Marker marker)
Adds a marker for display (in the foreground) against the range axis and sends a PlotChangeEvent to 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 (null not permitted).

See Also: removeRangeMarker

addRangeMarker

public void addRangeMarker(Marker marker, Layer layer)
Adds a marker for display against the range axis and sends a PlotChangeEvent to 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 (null not permitted). layer the layer (foreground or background) (null not permitted).

See Also: CategoryPlot

addRangeMarker

public void addRangeMarker(int index, Marker marker, Layer layer)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to 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: CategoryPlot

addRangeMarker

public void addRangeMarker(int index, Marker marker, Layer layer, boolean notify)
Adds a marker for display by a particular renderer and sends a PlotChangeEvent to 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?

Since: 1.0.10

See Also: CategoryPlot

calculateAxisSpace

protected AxisSpace calculateAxisSpace(Graphics2D g2, Rectangle2D plotArea)
Calculates the space required for the axes.

Parameters: g2 the graphics device. plotArea the plot area.

Returns: The space required for the axes.

calculateDomainAxisSpace

protected AxisSpace calculateDomainAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
Calculates the space required for the domain axis/axes.

Parameters: g2 the graphics device. plotArea the plot area. space a carrier for the result (null permitted).

Returns: The required space.

calculateRangeAxisSpace

protected AxisSpace calculateRangeAxisSpace(Graphics2D g2, Rectangle2D plotArea, AxisSpace space)
Calculates the space required for the range axis/axes.

Parameters: g2 the graphics device. plotArea the plot area. space a carrier for the result (null permitted).

Returns: The required space.

clearAnnotations

public void clearAnnotations()
Clears all the annotations and sends a PlotChangeEvent to all registered listeners.

clearDomainAxes

public void clearDomainAxes()
Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners.

clearDomainMarkers

public void clearDomainMarkers()
Clears all the domain markers for the plot and sends a PlotChangeEvent to all registered listeners.

See Also: clearRangeMarkers

clearDomainMarkers

public void clearDomainMarkers(int index)
Clears all the domain markers for the specified renderer.

Parameters: index the renderer index.

See Also: CategoryPlot

clearRangeAxes

public void clearRangeAxes()
Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners.

clearRangeMarkers

public void clearRangeMarkers()
Clears all the range markers for the plot and sends a PlotChangeEvent to all registered listeners.

See Also: clearDomainMarkers

clearRangeMarkers

public void clearRangeMarkers(int index)
Clears all the range markers for the specified renderer.

Parameters: index the renderer index.

See Also: CategoryPlot

clone

public Object clone()
Returns a clone of the plot.

Returns: A clone.

Throws: CloneNotSupportedException if the cloning is not supported.

configureDomainAxes

public void configureDomainAxes()
Configures the domain axes.

configureRangeAxes

public void configureRangeAxes()
Configures the range axes.

datasetChanged

public void datasetChanged(DatasetChangeEvent event)
Receives notification of a change to the plot's dataset.

The range axis bounds will be recalculated if necessary.

Parameters: event information about the event (not used here).

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.

Parameters: g2 the graphics device. area the area within which the plot (including axes) should be drawn. anchor the anchor point (null permitted). parentState the state from the parent plot, if there is one. state collects info as the chart is drawn (possibly null).

drawAnnotations

protected void drawAnnotations(Graphics2D g2, Rectangle2D dataArea)
Draws the annotations.

Parameters: g2 the graphics device. dataArea the data area.

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 (null permitted).

Returns: A map containing the axis states.

drawBackground

public void drawBackground(Graphics2D g2, Rectangle2D area)
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.

Parameters: g2 the graphics device. area the area within which the plot should be drawn.

drawDomainGridlines

protected void drawDomainGridlines(Graphics2D g2, Rectangle2D dataArea)
Draws the gridlines for the plot.

Parameters: g2 the graphics device. dataArea the area inside the axes.

See Also: CategoryPlot

drawDomainMarkers

protected void drawDomainMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
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: CategoryPlot

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.

Since: 1.0.5

drawRangeGridlines

protected void drawRangeGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks)
Draws the gridlines for the plot.

Parameters: g2 the graphics device. dataArea the area inside the axes. ticks the ticks.

See Also: CategoryPlot

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 (null not permitted). paint the line paint (null not permitted).

drawRangeMarkers

protected void drawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer)
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: CategoryPlot

equals

public boolean equals(Object obj)
Tests the plot for equality with an arbitrary object.

Parameters: obj the object to test against (null permitted).

Returns: A boolean.

getAnchorValue

public double getAnchorValue()
Returns the anchor value.

Returns: The anchor value.

See Also: CategoryPlot

getAnnotations

public List getAnnotations()
Returns the list of annotations.

Returns: The list of annotations (never null).

See Also: addAnnotation clearAnnotations

getAxisOffset

public RectangleInsets getAxisOffset()
Returns the axis offset.

Returns: The axis offset (never null).

See Also: setAxisOffset

getCategories

public List 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

getCategoriesForAxis

public List getCategoriesForAxis(CategoryAxis axis)
Returns a list of the categories that should be displayed for the specified axis.

Parameters: axis the axis (null not permitted)

Returns: The categories.

Since: 1.0.3

getColumnRenderingOrder

public SortOrder getColumnRenderingOrder()
Returns the order in which the columns are rendered. The default value is SortOrder.ASCENDING.

Returns: The column rendering order (never null

See Also: setColumnRenderingOrder

getDataRange

public Range getDataRange(ValueAxis axis)
Returns the range of data values that will be plotted against the range axis. If the dataset is null, this method returns null.

Parameters: axis the axis.

Returns: The data range.

getDataset

public CategoryDataset getDataset()
Returns the primary dataset for the plot.

Returns: The primary dataset (possibly null).

See Also: setDataset

getDataset

public CategoryDataset getDataset(int index)
Returns the dataset at the given index.

Parameters: index the dataset index.

Returns: The dataset (possibly null).

See Also: CategoryPlot

getDatasetCount

public int getDatasetCount()
Returns the number of datasets.

Returns: The number of datasets.

Since: 1.0.2

getDatasetRenderingOrder

public DatasetRenderingOrder getDatasetRenderingOrder()
Returns the dataset rendering order.

Returns: The order (never null).

See Also: setDatasetRenderingOrder

getDomainAxis

public CategoryAxis getDomainAxis()
Returns the domain axis for the plot. If the domain axis for this plot is null, then the method will return the parent plot's domain axis (if there is a parent plot).

Returns: The domain axis (null permitted).

See Also: setDomainAxis

getDomainAxis

public CategoryAxis getDomainAxis(int index)
Returns a domain axis.

Parameters: index the axis index.

Returns: The axis (null possible).

See Also: CategoryPlot

getDomainAxisCount

public int getDomainAxisCount()
Returns the number of domain axes.

Returns: The axis count.

getDomainAxisEdge

public RectangleEdge getDomainAxisEdge()
Returns the domain axis edge. This is derived from the axis location and the plot orientation.

Returns: The edge (never null).

getDomainAxisEdge

public RectangleEdge getDomainAxisEdge(int index)
Returns the edge for a domain axis.

Parameters: index the axis index.

Returns: The edge (never null).

getDomainAxisForDataset

public CategoryAxis getDomainAxisForDataset(int index)
Returns the domain axis for a dataset. You can change the axis for a dataset using the CategoryPlot method.

Parameters: index the dataset index.

Returns: The domain axis.

See Also: CategoryPlot

getDomainAxisIndex

public int getDomainAxisIndex(CategoryAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.

Parameters: axis the axis (null not permitted).

Returns: The axis index.

Since: 1.0.3

See Also: CategoryPlot

getDomainAxisLocation

public AxisLocation getDomainAxisLocation()
Returns the domain axis location for the primary domain axis.

Returns: The location (never null).

See Also: getRangeAxisLocation

getDomainAxisLocation

public AxisLocation getDomainAxisLocation(int index)
Returns the location for a domain axis.

Parameters: index the axis index.

Returns: The location.

See Also: CategoryPlot

getDomainGridlinePaint

public Paint getDomainGridlinePaint()
Returns the paint used to draw grid-lines against the domain axis.

Returns: The paint (never null).

See Also: setDomainGridlinePaint

getDomainGridlinePosition

public CategoryAnchor getDomainGridlinePosition()
Returns the position used for the domain gridlines.

Returns: The gridline position (never null).

See Also: setDomainGridlinePosition

getDomainGridlineStroke

public Stroke getDomainGridlineStroke()
Returns the stroke used to draw grid-lines against the domain axis.

Returns: The stroke (never null).

See Also: setDomainGridlineStroke

getDomainMarkers

public Collection getDomainMarkers(Layer layer)
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

public Collection getDomainMarkers(int index, Layer layer)
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).

getDrawSharedDomainAxis

public boolean getDrawSharedDomainAxis()
Returns the flag that controls whether or not the shared domain axis is drawn for each subplot.

Returns: A boolean.

See Also: CategoryPlot

getFixedDomainAxisSpace

public AxisSpace getFixedDomainAxisSpace()
Returns the fixed domain axis space.

Returns: The fixed domain axis space (possibly null).

See Also: setFixedDomainAxisSpace

getFixedLegendItems

public LegendItemCollection getFixedLegendItems()
Returns the fixed legend items, if any.

Returns: The legend items (possibly null).

See Also: setFixedLegendItems

getFixedRangeAxisSpace

public AxisSpace getFixedRangeAxisSpace()
Returns the fixed range axis space.

Returns: The fixed range axis space (possibly null).

See Also: setFixedRangeAxisSpace

getIndexOf

public int getIndexOf(CategoryItemRenderer renderer)
Returns the index of the specified renderer, or -1 if the renderer is not assigned to this plot.

Parameters: renderer the renderer (null permitted).

Returns: The renderer index.

getLegendItems

public LegendItemCollection 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.

Returns: The legend items.

getOrientation

public PlotOrientation getOrientation()
Returns the orientation of the plot.

Returns: The orientation of the plot (never null).

See Also: setOrientation

getPlotType

public String getPlotType()
Returns a string describing the type of plot.

Returns: The type.

getRangeAxis

public ValueAxis 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

public ValueAxis getRangeAxis(int index)
Returns a range axis.

Parameters: index the axis index.

Returns: The axis (null possible).

getRangeAxisCount

public int getRangeAxisCount()
Returns the number of range axes.

Returns: The axis count.

getRangeAxisEdge

public RectangleEdge getRangeAxisEdge()
Returns the edge where the primary range axis is located.

Returns: The edge (never null).

getRangeAxisEdge

public RectangleEdge getRangeAxisEdge(int index)
Returns the edge for a range axis.

Parameters: index the axis index.

Returns: The edge.

getRangeAxisForDataset

public ValueAxis getRangeAxisForDataset(int index)
Returns the range axis for a dataset. You can change the axis for a dataset using the CategoryPlot method.

Parameters: index the dataset index.

Returns: The range axis.

See Also: CategoryPlot

getRangeAxisIndex

public int getRangeAxisIndex(ValueAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot.

Parameters: axis the axis (null not permitted).

Returns: The axis index.

Since: 1.0.7

See Also: CategoryPlot

getRangeAxisLocation

public AxisLocation getRangeAxisLocation()
Returns the range axis location.

Returns: The location (never null).

getRangeAxisLocation

public AxisLocation getRangeAxisLocation(int index)
Returns the location for a range axis.

Parameters: index the axis index.

Returns: The location.

See Also: CategoryPlot

getRangeCrosshairPaint

public Paint getRangeCrosshairPaint()
Returns the paint used to draw the range crosshair.

Returns: The paint (never null).

See Also: setRangeCrosshairPaint isRangeCrosshairVisible getRangeCrosshairStroke

getRangeCrosshairStroke

public Stroke getRangeCrosshairStroke()
Returns the pen-style (Stroke) used to draw the crosshair (if visible).

Returns: The crosshair stroke (never null).

See Also: setRangeCrosshairStroke isRangeCrosshairVisible getRangeCrosshairPaint

getRangeCrosshairValue

public double getRangeCrosshairValue()
Returns the range crosshair value.

Returns: The value.

See Also: CategoryPlot

getRangeGridlinePaint

public Paint getRangeGridlinePaint()
Returns the paint used to draw the grid-lines against the range axis.

Returns: The paint (never null).

See Also: setRangeGridlinePaint

getRangeGridlineStroke

public Stroke getRangeGridlineStroke()
Returns the stroke used to draw the grid-lines against the range axis.

Returns: The stroke (never null).

See Also: setRangeGridlineStroke

getRangeMarkers

public Collection getRangeMarkers(Layer layer)
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: CategoryPlot

getRangeMarkers

public Collection getRangeMarkers(int index, Layer layer)
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).

getRenderer

public CategoryItemRenderer getRenderer()
Returns a reference to the renderer for the plot.

Returns: The renderer.

See Also: setRenderer

getRenderer

public CategoryItemRenderer getRenderer(int index)
Returns the renderer at the given index.

Parameters: index the renderer index.

Returns: The renderer (possibly null).

See Also: CategoryPlot

getRendererForDataset

public CategoryItemRenderer getRendererForDataset(CategoryDataset dataset)
Returns the renderer for the specified dataset. If the dataset doesn't belong to the plot, this method will return null.

Parameters: dataset the dataset (null permitted).

Returns: The renderer (possibly null).

getRowRenderingOrder

public SortOrder getRowRenderingOrder()
Returns the order in which the rows should be rendered. The default value is SortOrder.ASCENDING.

Returns: The order (never null).

See Also: setRowRenderingOrder

getWeight

public int getWeight()
Returns the weight for this plot when it is used as a subplot within a combined plot.

Returns: The weight.

See Also: CategoryPlot

handleClick

public void handleClick(int x, int y, PlotRenderingInfo info)
Handles a 'click' on the plot by updating the anchor value.

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.

isDomainGridlinesVisible

public boolean isDomainGridlinesVisible()
Returns the flag that controls whether the domain grid-lines are visible.

Returns: The true or false.

See Also: CategoryPlot

isDomainZoomable

public boolean isDomainZoomable()
Returns false to indicate that the domain axes are not zoomable.

Returns: A boolean.

See Also: isRangeZoomable

isRangeCrosshairLockedOnData

public boolean isRangeCrosshairLockedOnData()
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.

Returns: The flag.

See Also: CategoryPlot

isRangeCrosshairVisible

public boolean isRangeCrosshairVisible()
Returns a flag indicating whether or not the range crosshair is visible.

Returns: The flag.

See Also: CategoryPlot

isRangeGridlinesVisible

public boolean isRangeGridlinesVisible()
Returns the flag that controls whether the range grid-lines are visible.

Returns: The flag.

See Also: CategoryPlot

isRangeZoomable

public boolean isRangeZoomable()
Returns true to indicate that the range axes are zoomable.

Returns: A boolean.

See Also: isDomainZoomable

mapDatasetToDomainAxis

public void mapDatasetToDomainAxis(int index, int axisIndex)
Maps a dataset to a particular domain axis.

Parameters: index the dataset index (zero-based). axisIndex the axis index (zero-based).

See Also: CategoryPlot

mapDatasetToRangeAxis

public void mapDatasetToRangeAxis(int index, int axisIndex)
Maps a dataset to a particular range axis.

Parameters: index the dataset index (zero-based). axisIndex the axis index (zero-based).

See Also: CategoryPlot

removeAnnotation

public boolean removeAnnotation(CategoryAnnotation annotation)
Removes an annotation from the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: annotation the annotation (null not permitted).

Returns: A boolean (indicates whether or not the annotation was removed).

See Also: addAnnotation

removeAnnotation

public boolean removeAnnotation(CategoryAnnotation annotation, boolean notify)
Removes an annotation from the plot and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: annotation the annotation (null not permitted). notify notify listeners?

Returns: A boolean (indicates whether or not the annotation was removed).

Since: 1.0.10

removeDomainMarker

public boolean removeDomainMarker(Marker marker)
Removes a marker for the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: marker the marker.

Returns: A boolean indicating whether or not the marker was actually removed.

Since: 1.0.7

removeDomainMarker

public boolean removeDomainMarker(Marker marker, Layer layer)
Removes a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners.

Parameters: marker the marker (null not permitted). layer the layer (foreground or background).

Returns: A boolean indicating whether or not the marker was actually removed.

Since: 1.0.7

removeDomainMarker

public boolean removeDomainMarker(int index, Marker marker, Layer layer)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to 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.

Since: 1.0.7

removeDomainMarker

public boolean removeDomainMarker(int index, Marker marker, Layer layer, boolean notify)
Removes a marker for a specific dataset/renderer and, if requested, sends a PlotChangeEvent to 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.

Since: 1.0.10

removeRangeMarker

public boolean removeRangeMarker(Marker marker)
Removes a marker for the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: marker the marker.

Returns: A boolean indicating whether or not the marker was actually removed.

Since: 1.0.7

See Also: addRangeMarker

removeRangeMarker

public boolean removeRangeMarker(Marker marker, Layer layer)
Removes a marker for the range axis in the specified layer and sends a PlotChangeEvent to all registered listeners.

Parameters: marker the marker (null not permitted). layer the layer (foreground or background).

Returns: A boolean indicating whether or not the marker was actually removed.

Since: 1.0.7

See Also: CategoryPlot

removeRangeMarker

public boolean removeRangeMarker(int index, Marker marker, Layer layer)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to 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.

Since: 1.0.7

See Also: CategoryPlot

removeRangeMarker

public boolean removeRangeMarker(int index, Marker marker, Layer layer, boolean notify)
Removes a marker for a specific dataset/renderer and sends a PlotChangeEvent to 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.

Since: 1.0.10

See Also: CategoryPlot

render

public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info)
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.

Returns: A boolean that indicates whether or not real data was found.

rendererChanged

public void rendererChanged(RendererChangeEvent event)
Receives notification of a renderer change event.

Parameters: event the event.

setAnchorValue

public void setAnchorValue(double value)
Sets the anchor value and sends a PlotChangeEvent to all registered listeners.

Parameters: value the anchor value.

See Also: getAnchorValue

setAnchorValue

public void setAnchorValue(double value, boolean notify)
Sets the anchor value and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: value the value. notify notify listeners?

See Also: getAnchorValue

setAxisOffset

public void setAxisOffset(RectangleInsets offset)
Sets the axis offsets (gap between the data area and the axes) and sends a PlotChangeEvent to all registered listeners.

Parameters: offset the offset (null not permitted).

See Also: getAxisOffset

setColumnRenderingOrder

public void setColumnRenderingOrder(SortOrder order)
Sets the column order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.

Parameters: order the order (null not permitted).

See Also: getColumnRenderingOrder setRowRenderingOrder

setDataset

public void setDataset(CategoryDataset dataset)
Sets the dataset for the plot, replacing the existing dataset, if there is one. This method also calls the datasetChanged method, which adjusts the axis ranges if necessary and sends a PlotChangeEvent to all registered listeners.

Parameters: dataset the dataset (null permitted).

See Also: getDataset

setDataset

public void setDataset(int index, CategoryDataset dataset)
Sets a dataset for the plot.

Parameters: index the dataset index. dataset the dataset (null permitted).

See Also: CategoryPlot

setDatasetRenderingOrder

public void setDatasetRenderingOrder(DatasetRenderingOrder order)
Sets the rendering order and sends a PlotChangeEvent to 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 (null not permitted).

See Also: getDatasetRenderingOrder

setDomainAxes

public void setDomainAxes(CategoryAxis[] axes)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters: axes the axes (null not permitted).

See Also: (ValueAxis[])

setDomainAxis

public void setDomainAxis(CategoryAxis axis)
Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: axis the axis (null permitted).

See Also: getDomainAxis

setDomainAxis

public void setDomainAxis(int index, CategoryAxis axis)
Sets a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. axis the axis (null permitted).

See Also: CategoryPlot

setDomainAxis

public void setDomainAxis(int index, CategoryAxis axis, boolean notify)
Sets a domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. axis the axis (null permitted). notify notify listeners?

setDomainAxisLocation

public void setDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: location the axis location (null not permitted).

See Also: getDomainAxisLocation CategoryPlot

setDomainAxisLocation

public void setDomainAxisLocation(AxisLocation location, boolean notify)
Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: location the axis location (null not permitted). notify a flag that controls whether listeners are notified.

setDomainAxisLocation

public void setDomainAxisLocation(int index, AxisLocation location)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. location the location.

See Also: CategoryPlot CategoryPlot

setDomainAxisLocation

public void setDomainAxisLocation(int index, AxisLocation location, boolean notify)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. location the location. notify notify listeners?

Since: 1.0.5

See Also: CategoryPlot CategoryPlot

setDomainGridlinePaint

public void setDomainGridlinePaint(Paint paint)
Sets the paint used to draw the grid-lines (if any) against the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

See Also: getDomainGridlinePaint

setDomainGridlinePosition

public void setDomainGridlinePosition(CategoryAnchor position)
Sets the position used for the domain gridlines and sends a PlotChangeEvent to all registered listeners.

Parameters: position the position (null not permitted).

See Also: getDomainGridlinePosition

setDomainGridlinesVisible

public void setDomainGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against the domain axis.

If the flag value changes, a PlotChangeEvent is sent to all registered listeners.

Parameters: visible the new value of the flag.

See Also: isDomainGridlinesVisible

setDomainGridlineStroke

public void setDomainGridlineStroke(Stroke stroke)
Sets the stroke used to draw grid-lines against the domain axis and sends a PlotChangeEvent to all registered listeners.

Parameters: stroke the stroke (null not permitted).

See Also: getDomainGridlineStroke

setDrawSharedDomainAxis

public void setDrawSharedDomainAxis(boolean draw)
Sets the flag that controls whether the shared domain axis is drawn when this plot is being used as a subplot.

Parameters: draw a boolean.

See Also: getDrawSharedDomainAxis

setFixedDomainAxisSpace

public void setFixedDomainAxisSpace(AxisSpace space)
Sets the fixed domain axis space and sends a PlotChangeEvent to all registered listeners.

Parameters: space the space (null permitted).

See Also: getFixedDomainAxisSpace

setFixedDomainAxisSpace

public void setFixedDomainAxisSpace(AxisSpace space, boolean notify)
Sets the fixed domain axis space and sends a PlotChangeEvent to all registered listeners.

Parameters: space the space (null permitted). notify notify listeners?

Since: 1.0.7

See Also:

setFixedLegendItems

public void setFixedLegendItems(LegendItemCollection items)
Sets the fixed legend items for the plot. Leave this set to null if you prefer the legend items to be created automatically.

Parameters: items the legend items (null permitted).

See Also: getFixedLegendItems

setFixedRangeAxisSpace

public void setFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.

Parameters: space the space (null permitted).

See Also: getFixedRangeAxisSpace

setFixedRangeAxisSpace

public void setFixedRangeAxisSpace(AxisSpace space, boolean notify)
Sets the fixed range axis space and sends a PlotChangeEvent to all registered listeners.

Parameters: space the space (null permitted). notify notify listeners?

Since: 1.0.7

See Also:

setOrientation

public void setOrientation(PlotOrientation orientation)
Sets the orientation for the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: orientation the orientation (null not permitted).

See Also: getOrientation

setRangeAxes

public void setRangeAxes(ValueAxis[] axes)
Sets the range axes for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters: axes the axes (null not permitted).

See Also: (CategoryAxis[])

setRangeAxis

public void setRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: axis the axis (null permitted).

setRangeAxis

public void setRangeAxis(int index, ValueAxis axis)
Sets a range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. axis the axis.

setRangeAxis

public void setRangeAxis(int index, ValueAxis axis, boolean notify)
Sets a range axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. axis the axis. notify notify listeners?

setRangeAxisLocation

public void setRangeAxisLocation(AxisLocation location)
Sets the location of the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: location the location (null not permitted).

See Also: CategoryPlot setDomainAxisLocation

setRangeAxisLocation

public void setRangeAxisLocation(AxisLocation location, boolean notify)
Sets the location of the range axis and, if requested, sends a PlotChangeEvent to all registered listeners.

Parameters: location the location (null not permitted). notify notify listeners?

See Also: CategoryPlot

setRangeAxisLocation

public void setRangeAxisLocation(int index, AxisLocation location)
Sets the location for a range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. location the location.

See Also: CategoryPlot CategoryPlot

setRangeAxisLocation

public void setRangeAxisLocation(int index, AxisLocation location, boolean notify)
Sets the location for a range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: index the axis index. location the location. notify notify listeners?

See Also: CategoryPlot CategoryPlot

setRangeCrosshairLockedOnData

public void setRangeCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values, and sends a PlotChangeEvent to all registered listeners.

Parameters: flag the flag.

See Also: isRangeCrosshairLockedOnData

setRangeCrosshairPaint

public void setRangeCrosshairPaint(Paint paint)
Sets the paint used to draw the range crosshair (if visible) and sends a PlotChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

See Also: getRangeCrosshairPaint

setRangeCrosshairStroke

public void setRangeCrosshairStroke(Stroke stroke)
Sets the pen-style (Stroke) used to draw the range crosshair (if visible), and sends a PlotChangeEvent to all registered listeners.

Parameters: stroke the new crosshair stroke (null not permitted).

See Also: getRangeCrosshairStroke

setRangeCrosshairValue

public void setRangeCrosshairValue(double value)
Sets the range crosshair value and, if the crosshair is visible, sends a PlotChangeEvent to all registered listeners.

Parameters: value the new value.

See Also: getRangeCrosshairValue

setRangeCrosshairValue

public void setRangeCrosshairValue(double value, boolean notify)
Sets the range crosshair value and, if requested, sends a PlotChangeEvent to 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: getRangeCrosshairValue

setRangeCrosshairVisible

public void setRangeCrosshairVisible(boolean flag)
Sets the flag indicating whether or not the range crosshair is visible.

Parameters: flag the new value of the flag.

See Also: isRangeCrosshairVisible

setRangeGridlinePaint

public void setRangeGridlinePaint(Paint paint)
Sets the paint used to draw the grid lines against the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: paint the paint (null not permitted).

See Also: getRangeGridlinePaint

setRangeGridlinesVisible

public void setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not grid-lines are drawn against the range axis. If the flag changes value, a PlotChangeEvent is sent to all registered listeners.

Parameters: visible the new value of the flag.

See Also: isRangeGridlinesVisible

setRangeGridlineStroke

public void setRangeGridlineStroke(Stroke stroke)
Sets the stroke used to draw the grid-lines against the range axis and sends a PlotChangeEvent to all registered listeners.

Parameters: stroke the stroke (null not permitted).

See Also: getRangeGridlineStroke

setRenderer

public void setRenderer(CategoryItemRenderer renderer)
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and sends a PlotChangeEvent to all registered listeners.

Parameters: renderer the renderer (null permitted.

See Also: getRenderer

setRenderer

public void setRenderer(CategoryItemRenderer renderer, boolean notify)
Sets the renderer at index 0 (sometimes referred to as the "primary" renderer) and, if requested, sends a PlotChangeEvent to all registered listeners.

You can set the renderer to null, but this is not recommended because:

Parameters: renderer the renderer (null permitted). notify notify listeners?

See Also: getRenderer

setRenderer

public void setRenderer(int index, CategoryItemRenderer renderer)
Sets the renderer at the specified index and sends a PlotChangeEvent to all registered listeners.

Parameters: index the index. renderer the renderer (null permitted).

See Also: CategoryPlot CategoryPlot

setRenderer

public void setRenderer(int index, CategoryItemRenderer renderer, boolean notify)
Sets a renderer. A PlotChangeEvent is sent to all registered listeners.

Parameters: index the index. renderer the renderer (null permitted). notify notify listeners?

See Also: CategoryPlot

setRenderers

public void setRenderers(CategoryItemRenderer[] renderers)
Sets the renderers for this plot and sends a PlotChangeEvent to all registered listeners.

Parameters: renderers the renderers.

setRowRenderingOrder

public void setRowRenderingOrder(SortOrder order)
Sets the row order in which the items in each dataset should be rendered and sends a PlotChangeEvent to all registered listeners. Note that this affects the order in which items are drawn, NOT their position in the chart.

Parameters: order the order (null not permitted).

See Also: getRowRenderingOrder setColumnRenderingOrder

setWeight

public void setWeight(int weight)
Sets the weight for the plot and sends a PlotChangeEvent to all registered listeners.

Parameters: weight the weight.

See Also: getWeight

zoom

public void zoom(double percent)
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).

Parameters: percent the zoom amount.

zoomDomainAxes

public void zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.

Parameters: factor the zoom factor. state the plot state. source the source point (in Java2D space) for the zoom.

zoomDomainAxes

public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.

Parameters: lowerPercent the lower bound. upperPercent the upper bound. state the plot state. source the source point (in Java2D space) for the zoom.

zoomDomainAxes

public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
This method does nothing, because CategoryPlot doesn't support zooming on the domain.

Parameters: factor the zoom factor. info the plot rendering info. source the source point (in Java2D space). useAnchor use source point as zoom anchor?

Since: 1.0.7

See Also:

zoomRangeAxes

public void zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source)
Multiplies the range on the range axis/axes by the specified factor.

Parameters: factor the zoom factor. state the plot state. source the source point (in Java2D space) for the zoom.

zoomRangeAxes

public void zoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor)
Multiplies the range on the range axis/axes by the specified factor.

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.

Since: 1.0.7

See Also:

zoomRangeAxes

public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
Zooms in on the range axes.

Parameters: lowerPercent the lower bound. upperPercent the upper bound. state the plot state. source the source point (in Java2D space) for the zoom.