org.jfree.chart.plot
Class XYPlot

java.lang.Object
  extended byorg.jfree.chart.plot.Plot
      extended byorg.jfree.chart.plot.XYPlot
All Implemented Interfaces:
AxisChangeListener, AxisConstants, java.lang.Cloneable, DatasetChangeListener, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable, ValueAxisPlot
Direct Known Subclasses:
CombinedDomainXYPlot, CombinedRangeXYPlot, PeriodMarkerPlot

public class XYPlot
extends Plot
implements ValueAxisPlot, java.beans.PropertyChangeListener, java.lang.Cloneable, java.io.Serializable

A general class for plotting data in the form of (x, y) pairs. This plot can use data from any class that implements the XYDataset interface.

XYPlot makes use of an XYItemRenderer to draw each point on the plot. By using different renderers, various chart types can be produced.

The ChartFactory class contains static methods for creating pre-configured charts.

Author:
David Gilbert
See Also:
Serialized Form

Field Summary
static java.awt.Paint DEFAULT_CROSSHAIR_PAINT
          The default crosshair paint.
static java.awt.Stroke DEFAULT_CROSSHAIR_STROKE
          The default crosshair stroke.
static boolean DEFAULT_CROSSHAIR_VISIBLE
          The default crosshair visibility.
static java.awt.Paint DEFAULT_GRIDLINE_PAINT
          The default grid line paint.
static java.awt.Stroke DEFAULT_GRIDLINE_STROKE
          The default grid line stroke.
protected static java.util.ResourceBundle localizationResources
          The 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_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO
 
Fields inherited from interface org.jfree.chart.axis.AxisConstants
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_LINE_PAINT, DEFAULT_AXIS_LINE_STROKE, DEFAULT_AXIS_VISIBLE, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABELS_VISIBLE, DEFAULT_TICK_MARK_INSIDE_LENGTH, DEFAULT_TICK_MARK_OUTSIDE_LENGTH, DEFAULT_TICK_MARK_PAINT, DEFAULT_TICK_MARK_STROKE, DEFAULT_TICK_MARKS_VISIBLE
 
Constructor Summary
XYPlot()
          Default constructor.
XYPlot(XYDataset dataset, ValueAxis domainAxis, ValueAxis rangeAxis, XYItemRenderer renderer)
          Creates a new plot.
 
Method Summary
 void addAnnotation(XYAnnotation annotation)
          Adds an annotation to the plot.
 void addDomainMarker(Marker marker)
          Adds a marker for the domain axis.
 void addDomainMarker(Marker marker, org.jfree.ui.Layer layer)
          Adds a marker for the domain axis.
 void addRangeMarker(Marker marker)
          Adds a marker for the range axis.
 void addRangeMarker(Marker marker, org.jfree.ui.Layer layer)
          Adds a marker for the range axis.
 void addSecondaryDomainMarker(int index, Marker marker, org.jfree.ui.Layer layer)
          Adds a secondary marker for the domain axis.
 void addSecondaryDomainMarker(Marker marker)
          Adds a secondary marker for the domain axis.
 void addSecondaryRangeMarker(int index, Marker marker, org.jfree.ui.Layer layer)
          Adds a secondary marker for the range axis.
 void addSecondaryRangeMarker(Marker marker)
          Adds a secondary marker for the range axis.
protected  AxisSpace calculateAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea)
          Calculates the space required for the axes.
protected  AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, AxisSpace space)
          Calculates the space required for the domain axis/axes.
protected  AxisSpace calculateRangeAxisSpace(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, AxisSpace space)
          Calculates the space required for the range axis/axes.
 void clearAnnotations()
          Clears all the annotations.
 void clearDomainMarkers()
          Clears all the domain markers.
 void clearRangeMarkers()
          Clears all the range markers.
 void clearSecondaryDomainAxes()
          Clears the secondary domain axes from the plot.
 void clearSecondaryRangeAxes()
          Clears the secondary range axes from the plot.
 void clearSecondaryRangeMarkers()
          Deprecated. Use clearSecondaryRangeMarkers(int).
 void clearSecondaryRangeMarkers(int index)
          Clears the (foreground and background) range markers for a particular secondary range axis.
 java.lang.Object clone()
          Returns a clone of the plot.
 void configureSecondaryDomainAxes()
          Configures the secondary domain axes.
 void configureSecondaryRangeAxes()
          Configures the secondary range axes.
 void datasetChanged(DatasetChangeEvent event)
          Receives notification of a change to the plot's dataset.
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, PlotState parentState, PlotRenderingInfo state)
          Draws the plot on a Java 2D graphics device (such as the screen or a printer).
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, java.awt.geom.Point2D anchor, PlotState parentState, PlotRenderingInfo info)
          Draws the plot within the specified area on a graphics device.
 void drawAnnotations(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info)
          Draws the annotations for the plot.
protected  java.util.Map drawAxes(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Rectangle2D dataArea)
          A utility method for drawing the axes.
protected  void drawDomainGridlines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List ticks)
          Draws the gridlines for the plot, if they are visible.
protected  void drawDomainMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.Layer layer)
          Draws the domain markers (if any) for the specified layer.
 void drawDomainTickBands(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List ticks)
          Draws the domain tick bands, if any.
protected  void drawHorizontalLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, double value, java.awt.Stroke stroke, java.awt.Paint paint)
          Utility method for drawing a crosshair on the chart (if required).
protected  void drawRangeGridlines(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List ticks)
          Draws the gridlines for the plot, if they are visible.
protected  void drawRangeMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, org.jfree.ui.Layer layer)
          Draws the range markers (if any) for the specified layer.
 void drawRangeTickBands(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, java.util.List ticks)
          Draws the range tick bands, if any.
protected  void drawSecondaryDomainMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, int index, org.jfree.ui.Layer layer)
          Draws the secondary domain markers (if any) for an axis and layer.
protected  void drawSecondaryRangeMarkers(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, int index, org.jfree.ui.Layer layer)
          Draws the secondary range markers (if any) for an axis and layer.
protected  void drawVerticalLine(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, double value, java.awt.Stroke stroke, java.awt.Paint paint)
          Utility method for drawing a crosshair on the chart (if required).
 boolean equals(java.lang.Object obj)
          Tests this plot for equality with another object.
 Spacer getAxisOffset()
          Returns the axis offset.
 Range getDataRange(ValueAxis axis)
          Returns the range for the specified axis.
 XYDataset getDataset()
          Returns the primary dataset for the plot.
 ValueAxis getDomainAxis()
          Returns the domain axis for the plot.
 org.jfree.ui.RectangleEdge getDomainAxisEdge()
          Returns the edge for the domain axis (taking into account the plot's orientation.
 AxisLocation getDomainAxisLocation()
          Returns the location of the domain axis.
 java.awt.Paint getDomainCrosshairPaint()
          Returns the domain crosshair color.
 java.awt.Stroke getDomainCrosshairStroke()
          Returns the Stroke used to draw the crosshair (if visible).
 double getDomainCrosshairValue()
          Returns the domain crosshair value.
 java.awt.Paint getDomainGridlinePaint()
          Returns the paint for the grid lines (if any) plotted against the domain axis.
 java.awt.Stroke getDomainGridlineStroke()
          Returns the stroke for the grid-lines (if any) plotted against the domain axis.
 java.util.List getDomainMarkers(org.jfree.ui.Layer layer)
          Returns the list of domain markers (read only) for the specified layer.
 java.awt.Paint getDomainTickBandPaint()
          Returns the paint used for the domain tick bands.
 AxisSpace getFixedDomainAxisSpace()
          Returns the fixed domain axis space.
 AxisSpace getFixedRangeAxisSpace()
          Returns the fixed range axis space.
 LegendItemCollection getLegendItems()
          Returns the legend items for the plot.
 PlotOrientation getOrientation()
          Returns the orientation of the plot.
 java.lang.String getPlotType()
          Returns the plot type as a string.
 ValueAxis getRangeAxis()
          Returns the range axis for the plot.
 org.jfree.ui.RectangleEdge getRangeAxisEdge()
          Returns the edge for the range axis.
 AxisLocation getRangeAxisLocation()
          Returns the location of the range axis.
 java.awt.Paint getRangeCrosshairPaint()
          Returns the range crosshair color.
 java.awt.Stroke getRangeCrosshairStroke()
          Returns the Stroke used to draw the crosshair (if visible).
 double getRangeCrosshairValue()
          Returns the range crosshair value.
 java.awt.Paint getRangeGridlinePaint()
          Returns the paint for the grid lines (if any) plotted against the range axis.
 java.awt.Stroke getRangeGridlineStroke()
          Returns the stroke for the grid lines (if any) plotted against the range axis.
 java.util.List getRangeMarkers(org.jfree.ui.Layer layer)
          Returns the list of range markers (read only) for the specified layer.
 java.awt.Paint getRangeTickBandPaint()
          Returns the paint used for the range tick bands.
 XYItemRenderer getRenderer()
          Returns the item renderer.
 XYDataset getSecondaryDataset(int index)
          Returns one of the secondary datasets.
 int getSecondaryDatasetCount()
          Returns the number of secondary datasets.
 ValueAxis getSecondaryDomainAxis(int index)
          Returns a secondary domain axis.
 int getSecondaryDomainAxisCount()
          Returns the number of secondary domain axes.
 org.jfree.ui.RectangleEdge getSecondaryDomainAxisEdge(int index)
          Returns the edge for a secondary domain axis.
 AxisLocation getSecondaryDomainAxisLocation(int index)
          Returns the location for a secondary domain axis.
 ValueAxis getSecondaryDomainAxisMappedToDataset(int index)
          Returns the domain axis for a secondary dataset.
 java.util.Collection getSecondaryDomainMarkers(int index, org.jfree.ui.Layer layer)
          Returns a collection of secondary domain markers for a particular axis and layer.
 ValueAxis getSecondaryRangeAxis(int index)
          Returns a secondary range axis.
 int getSecondaryRangeAxisCount()
          Returns the number of secondary range axes.
 org.jfree.ui.RectangleEdge getSecondaryRangeAxisEdge(int index)
          Returns the edge for a secondary range axis.
 AxisLocation getSecondaryRangeAxisLocation(int index)
          Returns the location for a secondary range axis.
 ValueAxis getSecondaryRangeAxisMappedToDataset(int index)
          Returns the range axis for a secondary dataset.
 java.util.Collection getSecondaryRangeMarkers(int index, org.jfree.ui.Layer layer)
          Returns a collection of secondary range markers for a particular axis and layer.
 XYItemRenderer getSecondaryRenderer(int index)
          Returns a secondary renderer.
 int getSeriesCount()
          Returns the number of series in the primary dataset for this plot.
 int getWeight()
          Returns the weight for this plot when it is used as a subplot within a combined plot.
 void handleClick(int x, int y, PlotRenderingInfo info)
          Handles a 'click' on the plot by updating the anchor values...
 boolean isDomainCrosshairLockedOnData()
          Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
 boolean isDomainCrosshairVisible()
          Returns a flag indicating whether or not the domain crosshair is visible.
 boolean isDomainGridlinesVisible()
          Returns true if the domain gridlines are visible, and false otherwise.
 boolean isRangeCrosshairLockedOnData()
          Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.
 boolean isRangeCrosshairVisible()
          Returns a flag indicating whether or not the range crosshair is visible.
 boolean isRangeGridlinesVisible()
          Returns true if the range axis grid is visible, and false otherwise.
 void mapSecondaryDatasetToDomainAxis(int index, java.lang.Integer key)
          Maps a secondary dataset to a particular domain axis.
 void mapSecondaryDatasetToRangeAxis(int index, java.lang.Integer key)
          Maps a secondary dataset to a particular range axis.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Notifies all registered listeners of a property change.
 void render(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, CrosshairInfo crosshairInfo)
          Draws a representation of the data within the dataArea region, using the current renderer.
 void render2(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, CrosshairInfo crosshairInfo)
          Draws a representation of the data within the dataArea region, using the current renderer.
 void setAxisOffset(Spacer offset)
          Sets the axis offsets (gap between the data area and the axes).
 void setDataset(XYDataset dataset)
          Sets the dataset for the plot, replacing the existing dataset if there is one.
 void setDomainAxis(ValueAxis axis)
          Sets the domain axis for the plot.
 void setDomainAxisLocation(AxisLocation location)
          Sets the location of the domain axis.
 void setDomainAxisLocation(AxisLocation location, boolean notify)
          Sets the location of the domain axis (TOP, BOTTOM, LEFT or RIGHT).
 void setDomainCrosshairLockedOnData(boolean flag)
          Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values.
 void setDomainCrosshairPaint(java.awt.Paint paint)
          Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
 void setDomainCrosshairStroke(java.awt.Stroke stroke)
          Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
 void setDomainCrosshairValue(double value)
          Sets the domain crosshair value.
 void setDomainCrosshairValue(double value, boolean notify)
          Sets the domain crosshair value.
 void setDomainCrosshairVisible(boolean flag)
          Sets the flag indicating whether or not the domain crosshair is visible.
 void setDomainGridlinePaint(java.awt.Paint paint)
          Sets the paint for the grid lines plotted against the domain axis.
 void setDomainGridlineStroke(java.awt.Stroke stroke)
          Sets the stroke for the grid lines plotted against the domain axis.
 void setDomainGridlinesVisible(boolean visible)
          Sets the flag that controls whether or not the domain grid-lines are visible.
 void setDomainTickBandPaint(java.awt.Paint paint)
          Sets the paint for the domain tick bands.
 void setFixedDomainAxisSpace(AxisSpace space)
          Sets the fixed domain axis space.
 void setFixedRangeAxisSpace(AxisSpace space)
          Sets the fixed range axis space.
 void setOrientation(PlotOrientation orientation)
          Sets the orientation for the plot.
 void setRangeAxis(ValueAxis axis)
          Sets the range axis for the plot.
 void setRangeAxisLocation(AxisLocation location)
          Sets the location of the range axis.
 void setRangeAxisLocation(AxisLocation location, boolean notify)
          Sets the location of the range axis.
 void setRangeCrosshairLockedOnData(boolean flag)
          Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.
 void setRangeCrosshairPaint(java.awt.Paint paint)
          Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
 void setRangeCrosshairStroke(java.awt.Stroke stroke)
          Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.
 void setRangeCrosshairValue(double value)
          Sets the domain crosshair value.
 void setRangeCrosshairValue(double value, boolean notify)
          Sets the range crosshair value.
 void setRangeCrosshairVisible(boolean flag)
          Sets the flag indicating whether or not the range crosshair is visible.
 void setRangeGridlinePaint(java.awt.Paint paint)
          Sets the paint for the grid lines plotted against the range axis.
 void setRangeGridlineStroke(java.awt.Stroke stroke)
          Sets the stroke for the grid lines plotted against the range axis.
 void setRangeGridlinesVisible(boolean visible)
          Sets the flag that controls whether or not the range axis grid lines are visible.
 void setRangeTickBandPaint(java.awt.Paint paint)
          Sets the paint for the range tick bands.
 void setRenderer(XYItemRenderer renderer)
          Sets the item renderer, and notifies all listeners of a change to the plot.
 void setSecondaryDataset(int index, XYDataset dataset)
          Adds or changes a secondary dataset for the plot.
 void setSecondaryDomainAxis(int index, ValueAxis axis)
          Sets a secondary domain axis.
 void setSecondaryDomainAxisLocation(int index, AxisLocation location)
          Sets the location for a secondary domain axis.
 void setSecondaryRangeAxis(int index, ValueAxis axis)
          Sets a secondary range axis.
 void setSecondaryRangeAxisLocation(int index, AxisLocation location)
          Sets the location for a secondary range axis.
 void setSecondaryRenderer(int index, XYItemRenderer renderer)
          Sets a secondary renderer.
 void setWeight(int weight)
          Sets the weight for the plot.
 void zoom(double percent)
          Zooms the axis ranges by the specified percentage about the anchor point.
 void zoomHorizontalAxes(double factor)
          Multiplies the range on the horizontal axis/axes by the specified factor.
 void zoomHorizontalAxes(double lowerPercent, double upperPercent)
          Zooms in on the horizontal axes.
 void zoomVerticalAxes(double factor)
          Multiplies the range on the vertical axis/axes by the specified factor.
 void zoomVerticalAxes(double lowerPercent, double upperPercent)
          Zooms in on the vertical axes.
 
Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, drawBackground, drawNoDataMessage, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundPaint, getDataAreaRatio, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, isSubplot, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundPaint, setDataAreaRatio, setDatasetGroup, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_GRIDLINE_STROKE

public static final java.awt.Stroke DEFAULT_GRIDLINE_STROKE
The default grid line stroke.


DEFAULT_GRIDLINE_PAINT

public static final java.awt.Paint DEFAULT_GRIDLINE_PAINT
The default grid line paint.


DEFAULT_CROSSHAIR_VISIBLE

public static final boolean DEFAULT_CROSSHAIR_VISIBLE
The default crosshair visibility.

See Also:
Constant Field Values

DEFAULT_CROSSHAIR_STROKE

public static final java.awt.Stroke DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke.


DEFAULT_CROSSHAIR_PAINT

public static final java.awt.Paint DEFAULT_CROSSHAIR_PAINT
The default crosshair paint.


localizationResources

protected static java.util.ResourceBundle localizationResources
The resourceBundle for the localization.

Constructor Detail

XYPlot

public XYPlot()
Default constructor.


XYPlot

public XYPlot(XYDataset dataset,
              ValueAxis domainAxis,
              ValueAxis rangeAxis,
              XYItemRenderer 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 renderer (null permitted).
Method Detail

getPlotType

public java.lang.String getPlotType()
Returns the plot type as a string.

Specified by:
getPlotType in class Plot
Returns:
a short string describing the type of plot.

getOrientation

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

Returns:
The orientation of the plot.

setOrientation

public void setOrientation(PlotOrientation orientation)
Sets the orientation for the plot.

Parameters:
orientation - the orientation (null not allowed).

getAxisOffset

public Spacer getAxisOffset()
Returns the axis offset.

Returns:
The axis offset.

setAxisOffset

public void setAxisOffset(Spacer offset)
Sets the axis offsets (gap between the data area and the axes).

Parameters:
offset - the offset.

getDomainAxis

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

setDomainAxis

public void setDomainAxis(ValueAxis axis)
Sets the domain axis for the plot.

Parameters:
axis - the new axis.

getDomainAxisLocation

public AxisLocation getDomainAxisLocation()
Returns the location of the domain axis.

Returns:
the location.

setDomainAxisLocation

public void setDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis.

Use one of the constants LEFT, RIGHT, TOP or BOTTOM.

Parameters:
location - the axis location.

setDomainAxisLocation

public void setDomainAxisLocation(AxisLocation location,
                                  boolean notify)
Sets the location of the domain axis (TOP, BOTTOM, LEFT or RIGHT).

Parameters:
location - the axis location.
notify - a flag that controls whether listeners are notified.

getDomainAxisEdge

public org.jfree.ui.RectangleEdge getDomainAxisEdge()
Returns the edge for the domain axis (taking into account the plot's orientation.

Returns:
The edge.

getSecondaryDomainAxis

public ValueAxis getSecondaryDomainAxis(int index)
Returns a secondary domain axis.

Parameters:
index - the axis index.
Returns:
The axis (null possible).

setSecondaryDomainAxis

public void setSecondaryDomainAxis(int index,
                                   ValueAxis axis)
Sets a secondary domain axis.

Parameters:
index - the axis index.
axis - the axis.

getSecondaryDomainAxisCount

public int getSecondaryDomainAxisCount()
Returns the number of secondary domain axes.

Returns:
The axis count.

clearSecondaryDomainAxes

public void clearSecondaryDomainAxes()
Clears the secondary domain axes from the plot.


configureSecondaryDomainAxes

public void configureSecondaryDomainAxes()
Configures the secondary domain axes.


getSecondaryDomainAxisLocation

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

Parameters:
index - the axis index.
Returns:
The location.

setSecondaryDomainAxisLocation

public void setSecondaryDomainAxisLocation(int index,
                                           AxisLocation location)
Sets the location for a secondary domain axis.

Parameters:
index - the axis index.
location - the location.

getSecondaryDomainAxisEdge

public org.jfree.ui.RectangleEdge getSecondaryDomainAxisEdge(int index)
Returns the edge for a secondary domain axis.

Parameters:
index - the axis index.
Returns:
The edge.

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.

setRangeAxis

public void setRangeAxis(ValueAxis axis)
Sets the range axis for the plot.

An exception is thrown if the new axis and the plot are not mutually compatible.

Parameters:
axis - the new axis (null permitted).

getRangeAxisLocation

public AxisLocation getRangeAxisLocation()
Returns the location of the range axis.

Returns:
the location.

setRangeAxisLocation

public void setRangeAxisLocation(AxisLocation location)
Sets the location of the range axis.

Parameters:
location - the location.

setRangeAxisLocation

public void setRangeAxisLocation(AxisLocation location,
                                 boolean notify)
Sets the location of the range axis.

Parameters:
location - the location.
notify - a flag that controls whether listeners are notified.

getRangeAxisEdge

public org.jfree.ui.RectangleEdge getRangeAxisEdge()
Returns the edge for the range axis.

Returns:
The range axis edge.

getSecondaryRangeAxis

public ValueAxis getSecondaryRangeAxis(int index)
Returns a secondary range axis.

Parameters:
index - the axis index.
Returns:
The axis (null possible).

setSecondaryRangeAxis

public void setSecondaryRangeAxis(int index,
                                  ValueAxis axis)
Sets a secondary range axis.

Parameters:
index - the axis index.
axis - the axis.

getSecondaryRangeAxisCount

public int getSecondaryRangeAxisCount()
Returns the number of secondary range axes.

Returns:
The axis count.

clearSecondaryRangeAxes

public void clearSecondaryRangeAxes()
Clears the secondary range axes from the plot.


configureSecondaryRangeAxes

public void configureSecondaryRangeAxes()
Configures the secondary range axes.


getSecondaryRangeAxisLocation

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

Parameters:
index - the axis index.
Returns:
The location.

setSecondaryRangeAxisLocation

public void setSecondaryRangeAxisLocation(int index,
                                          AxisLocation location)
Sets the location for a secondary range axis.

Parameters:
index - the axis index.
location - the location.

getSecondaryRangeAxisEdge

public org.jfree.ui.RectangleEdge getSecondaryRangeAxisEdge(int index)
Returns the edge for a secondary range axis.

Parameters:
index - the axis index.
Returns:
The edge.

getDataset

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

Returns:
The primary dataset (possibly null).

setDataset

public void setDataset(XYDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there is one.

Parameters:
dataset - the dataset (null permitted).

getSecondaryDataset

public XYDataset getSecondaryDataset(int index)
Returns one of the secondary datasets.

Parameters:
index - the dataset index.
Returns:
The dataset (possibly null).

getSecondaryDatasetCount

public int getSecondaryDatasetCount()
Returns the number of secondary datasets.

Returns:
The number of secondary datasets.

setSecondaryDataset

public void setSecondaryDataset(int index,
                                XYDataset dataset)
Adds or changes a secondary dataset for the plot.

Parameters:
index - the dataset index.
dataset - the dataset.

mapSecondaryDatasetToDomainAxis

public void mapSecondaryDatasetToDomainAxis(int index,
                                            java.lang.Integer key)
Maps a secondary dataset to a particular domain axis.

Parameters:
index - the dataset index (zero-based).
key - the key (null for primary axis, or the index of the secondary axis).

mapSecondaryDatasetToRangeAxis

public void mapSecondaryDatasetToRangeAxis(int index,
                                           java.lang.Integer key)
Maps a secondary dataset to a particular range axis.

Parameters:
index - the dataset index (zero-based).
key - the key (null for primary axis, or the index of the secondary axis).

getRenderer

public XYItemRenderer getRenderer()
Returns the item renderer.

Returns:
The item renderer (possibly null).

setRenderer

public void setRenderer(XYItemRenderer renderer)
Sets the item renderer, and notifies all listeners of a change to the plot.

If the renderer is set to null, no chart will be drawn.

Parameters:
renderer - the new renderer (null permitted).

getSecondaryRenderer

public XYItemRenderer getSecondaryRenderer(int index)
Returns a secondary renderer.

Parameters:
index - the renderer index.
Returns:
The renderer (possibly null).

setSecondaryRenderer

public void setSecondaryRenderer(int index,
                                 XYItemRenderer renderer)
Sets a secondary renderer. A PlotChangeEvent is sent to all registered listeners.

Parameters:
index - the index.
renderer - the renderer.

getWeight

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

Returns:
the weight.

setWeight

public void setWeight(int weight)
Sets the weight for the plot.

Parameters:
weight - the weight.

isDomainGridlinesVisible

public boolean isDomainGridlinesVisible()
Returns true if the domain gridlines are visible, and false otherwise.

Returns:
true or false.

setDomainGridlinesVisible

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

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

Parameters:
visible - the new value of the flag.

getDomainGridlineStroke

public java.awt.Stroke getDomainGridlineStroke()
Returns the stroke for the grid-lines (if any) plotted against the domain axis.

Returns:
the stroke.

setDomainGridlineStroke

public void setDomainGridlineStroke(java.awt.Stroke stroke)
Sets the stroke for the grid lines plotted against the domain axis.

If you set this to null, no grid lines will be drawn.

Parameters:
stroke - the stroke (null permitted).

getDomainGridlinePaint

public java.awt.Paint getDomainGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the domain axis.

Returns:
the paint.

setDomainGridlinePaint

public void setDomainGridlinePaint(java.awt.Paint paint)
Sets the paint for the grid lines plotted against the domain axis.

If you set this to null, no grid lines will be drawn.

Parameters:
paint - the paint (null permitted).

isRangeGridlinesVisible

public boolean isRangeGridlinesVisible()
Returns true if the range axis grid is visible, and false otherwise.

Returns:
true or false.

setRangeGridlinesVisible

public void setRangeGridlinesVisible(boolean visible)
Sets the flag that controls whether or not the range axis grid lines are visible.

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

Parameters:
visible - the new value of the flag.

getRangeGridlineStroke

public java.awt.Stroke getRangeGridlineStroke()
Returns the stroke for the grid lines (if any) plotted against the range axis.

Returns:
the stroke.

setRangeGridlineStroke

public void setRangeGridlineStroke(java.awt.Stroke stroke)
Sets the stroke for the grid lines plotted against the range axis.

If you set this to null, no grid lines will be drawn.

Parameters:
stroke - the stroke (null permitted).

getRangeGridlinePaint

public java.awt.Paint getRangeGridlinePaint()
Returns the paint for the grid lines (if any) plotted against the range axis.

Returns:
the paint.

setRangeGridlinePaint

public void setRangeGridlinePaint(java.awt.Paint paint)
Sets the paint for the grid lines plotted against the range axis.

If you set this to null, no grid lines will be drawn.

Parameters:
paint - the paint (null permitted).

getDomainTickBandPaint

public java.awt.Paint getDomainTickBandPaint()
Returns the paint used for the domain tick bands. If this is null, no tick bands will be drawn.

Returns:
The paint (possibly null).

setDomainTickBandPaint

public void setDomainTickBandPaint(java.awt.Paint paint)
Sets the paint for the domain tick bands.

Parameters:
paint - the paint (null permitted).

getRangeTickBandPaint

public java.awt.Paint getRangeTickBandPaint()
Returns the paint used for the range tick bands. If this is null, no tick bands will be drawn.

Returns:
The paint (possibly null).

setRangeTickBandPaint

public void setRangeTickBandPaint(java.awt.Paint paint)
Sets the paint for the range tick bands.

Parameters:
paint - the paint (null permitted).

addDomainMarker

public void addDomainMarker(Marker marker)
Adds a marker for the domain axis.

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.

addDomainMarker

public void addDomainMarker(Marker marker,
                            org.jfree.ui.Layer layer)
Adds a marker for the domain axis.

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.
layer - the layer (foreground or background).

clearDomainMarkers

public void clearDomainMarkers()
Clears all the domain markers.


addSecondaryDomainMarker

public void addSecondaryDomainMarker(Marker marker)
Adds a secondary marker for the domain axis.

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.

addSecondaryDomainMarker

public void addSecondaryDomainMarker(int index,
                                     Marker marker,
                                     org.jfree.ui.Layer layer)
Adds a secondary marker for the domain axis.

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:
index - the secondary axis index.
marker - the marker.
layer - the layer (foreground or background).

addRangeMarker

public void addRangeMarker(Marker marker)
Adds a marker for the range axis.

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.

addRangeMarker

public void addRangeMarker(Marker marker,
                           org.jfree.ui.Layer layer)
Adds a marker for the range axis.

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.
layer - the layer (foreground or background).

clearRangeMarkers

public void clearRangeMarkers()
Clears all the range markers.


addSecondaryRangeMarker

public void addSecondaryRangeMarker(Marker marker)
Adds a secondary marker for the range axis.

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.

addSecondaryRangeMarker

public void addSecondaryRangeMarker(int index,
                                    Marker marker,
                                    org.jfree.ui.Layer layer)
Adds a secondary marker for the range axis.

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:
index - the secondary axis index.
marker - the marker.
layer - the layer (foreground or background).

clearSecondaryRangeMarkers

public void clearSecondaryRangeMarkers()
Deprecated. Use clearSecondaryRangeMarkers(int).

Clears all the secondary range markers.


clearSecondaryRangeMarkers

public void clearSecondaryRangeMarkers(int index)
Clears the (foreground and background) range markers for a particular secondary range axis.

Parameters:
index - the secondary range axis index.

addAnnotation

public void addAnnotation(XYAnnotation annotation)
Adds an annotation to the plot.

Parameters:
annotation - the annotation.

clearAnnotations

public void clearAnnotations()
Clears all the annotations.


calculateDomainAxisSpace

protected AxisSpace calculateDomainAxisSpace(java.awt.Graphics2D g2,
                                             java.awt.geom.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(java.awt.Graphics2D g2,
                                            java.awt.geom.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.

calculateAxisSpace

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

Parameters:
g2 - the graphics device.
plotArea - the plot area.
Returns:
The required space.

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D area,
                 PlotState parentState,
                 PlotRenderingInfo state)
Draws the plot on a Java 2D graphics device (such as the screen or a printer).

This plot relies on an XYItemRenderer to draw each item in the plot. This allows the visual representation of the data to be changed easily.

The optional info argument collects information about the rendering of the plot (dimensions, tooltip information etc). Just pass in null if you do not need this information.

Specified by:
draw in class Plot
Parameters:
g2 - the graphics device.
area - the area within which the plot (including axes and labels) should be drawn.
parentState - the state from the parent plot, if there is one.
state - collects chart drawing information (null permitted).

draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D area,
                 java.awt.geom.Point2D anchor,
                 PlotState parentState,
                 PlotRenderingInfo info)
Draws the plot within the specified area on a graphics device.

Overrides:
draw in class Plot
Parameters:
g2 - the graphics device.
area - the plot area (in Java2D space).
anchor - an anchor point in Java2D space (null permitted).
parentState - the state from the parent plot, if there is one (null permitted).
info - collects chart drawing information (null permitted).

drawDomainTickBands

public void drawDomainTickBands(java.awt.Graphics2D g2,
                                java.awt.geom.Rectangle2D dataArea,
                                java.util.List ticks)
Draws the domain tick bands, if any.

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

drawRangeTickBands

public void drawRangeTickBands(java.awt.Graphics2D g2,
                               java.awt.geom.Rectangle2D dataArea,
                               java.util.List ticks)
Draws the range tick bands, if any.

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

drawAxes

protected java.util.Map drawAxes(java.awt.Graphics2D g2,
                                 java.awt.geom.Rectangle2D plotArea,
                                 java.awt.geom.Rectangle2D dataArea)
A utility method for drawing the axes.

Parameters:
g2 - the graphics device.
plotArea - the plot area.
dataArea - the data area.
Returns:
A map containing the state for each axis drawn.

render

public void render(java.awt.Graphics2D g2,
                   java.awt.geom.Rectangle2D dataArea,
                   PlotRenderingInfo info,
                   CrosshairInfo crosshairInfo)
Draws a representation of the data within the dataArea region, using the current renderer.

The info and crosshairInfo arguments may be null.

Parameters:
g2 - the graphics device.
dataArea - the region in which the data is to be drawn.
info - an optional object for collection dimension information.
crosshairInfo - an optional object for collecting crosshair info.

getSecondaryDomainAxisMappedToDataset

public ValueAxis getSecondaryDomainAxisMappedToDataset(int index)
Returns the domain axis for a secondary dataset.

Parameters:
index - the dataset index.
Returns:
the axis

getSecondaryRangeAxisMappedToDataset

public ValueAxis getSecondaryRangeAxisMappedToDataset(int index)
Returns the range axis for a secondary dataset.

Parameters:
index - the dataset index.
Returns:
the axis

render2

public void render2(java.awt.Graphics2D g2,
                    java.awt.geom.Rectangle2D dataArea,
                    PlotRenderingInfo info,
                    CrosshairInfo crosshairInfo)
Draws a representation of the data within the dataArea region, using the current renderer.

The info and crosshairInfo arguments may be null.

Parameters:
g2 - the graphics device.
dataArea - the region in which the data is to be drawn.
info - an optional object for collection dimension information.
crosshairInfo - an optional object for collecting crosshair info.

drawDomainGridlines

protected void drawDomainGridlines(java.awt.Graphics2D g2,
                                   java.awt.geom.Rectangle2D dataArea,
                                   java.util.List ticks)
Draws the gridlines for the plot, if they are visible.

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

drawRangeGridlines

protected void drawRangeGridlines(java.awt.Graphics2D g2,
                                  java.awt.geom.Rectangle2D dataArea,
                                  java.util.List ticks)
Draws the gridlines for the plot, if they are visible.

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

drawAnnotations

public void drawAnnotations(java.awt.Graphics2D g2,
                            java.awt.geom.Rectangle2D dataArea,
                            PlotRenderingInfo info)
Draws the annotations for the plot.

Parameters:
g2 - the graphics device.
dataArea - the data area.
info - the chart rendering info.

drawDomainMarkers

protected void drawDomainMarkers(java.awt.Graphics2D g2,
                                 java.awt.geom.Rectangle2D dataArea,
                                 org.jfree.ui.Layer layer)
Draws the domain markers (if any) for the specified layer. This method is typically called from within the draw(...) method.

Parameters:
g2 - the graphics device.
dataArea - the data area.
layer - the layer (foreground or background).

drawRangeMarkers

protected void drawRangeMarkers(java.awt.Graphics2D g2,
                                java.awt.geom.Rectangle2D dataArea,
                                org.jfree.ui.Layer layer)
Draws the range markers (if any) for the specified layer. This method is typically called from within the draw(...) method.

Parameters:
g2 - the graphics device.
dataArea - the data area.
layer - the layer (foreground or background).

drawSecondaryDomainMarkers

protected void drawSecondaryDomainMarkers(java.awt.Graphics2D g2,
                                          java.awt.geom.Rectangle2D dataArea,
                                          int index,
                                          org.jfree.ui.Layer layer)
Draws the secondary 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 secondary domain axis index.
layer - the layer (foreground or background).

drawSecondaryRangeMarkers

protected void drawSecondaryRangeMarkers(java.awt.Graphics2D g2,
                                         java.awt.geom.Rectangle2D dataArea,
                                         int index,
                                         org.jfree.ui.Layer layer)
Draws the secondary 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 secondary range axis index.
layer - the layer (foreground or background).

getDomainMarkers

public java.util.List getDomainMarkers(org.jfree.ui.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.

getRangeMarkers

public java.util.List getRangeMarkers(org.jfree.ui.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.

getSecondaryDomainMarkers

public java.util.Collection getSecondaryDomainMarkers(int index,
                                                      org.jfree.ui.Layer layer)
Returns a collection of secondary domain markers for a particular axis and layer.

Parameters:
index - the secondary axis index.
layer - the layer.
Returns:
A collection of markers (possibly null).

getSecondaryRangeMarkers

public java.util.Collection getSecondaryRangeMarkers(int index,
                                                     org.jfree.ui.Layer layer)
Returns a collection of secondary range markers for a particular axis and layer.

Parameters:
index - the secondary axis index.
layer - the layer.
Returns:
A collection of markers (possibly null).

drawVerticalLine

protected void drawVerticalLine(java.awt.Graphics2D g2,
                                java.awt.geom.Rectangle2D dataArea,
                                double value,
                                java.awt.Stroke stroke,
                                java.awt.Paint paint)
Utility method for drawing a crosshair on the chart (if required).

Parameters:
g2 - the graphics device.
dataArea - the data area.
value - the coordinate, where to draw the line.
stroke - the stroke to use.
paint - the paint to use.

drawHorizontalLine

protected void drawHorizontalLine(java.awt.Graphics2D g2,
                                  java.awt.geom.Rectangle2D dataArea,
                                  double value,
                                  java.awt.Stroke stroke,
                                  java.awt.Paint paint)
Utility method for drawing a crosshair on the chart (if required).

Parameters:
g2 - the graphics device.
dataArea - the data area.
value - the coordinate, where to draw the line.
stroke - the stroke to use.
paint - the paint to use.

handleClick

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

Overrides:
handleClick in class Plot
Parameters:
x - the x-coordinate, where the click occurred, in Java2D space.
y - the y-coordinate, where the click occurred, in Java2D space.
info - object containing information about the plot dimensions.

zoom

public void zoom(double percent)
Zooms the axis ranges by the specified percentage about the anchor point.

Overrides:
zoom in class Plot
Parameters:
percent - the amount of the zoom.

getDataRange

public Range getDataRange(ValueAxis axis)
Returns the range for the specified axis.

Specified by:
getDataRange in interface ValueAxisPlot
Parameters:
axis - the axis.
Returns:
the range.

datasetChanged

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

The axis ranges are updated if necessary.

Specified by:
datasetChanged in interface DatasetChangeListener
Overrides:
datasetChanged in class Plot
Parameters:
event - information about the event (not used here).

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Notifies all registered listeners of a property change.

One source of property change events is the plot's renderer.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - information about the property change.

isDomainCrosshairVisible

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

Returns:
the flag.

setDomainCrosshairVisible

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

Parameters:
flag - the new value of the flag.

isDomainCrosshairLockedOnData

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

Returns:
the flag.

setDomainCrosshairLockedOnData

public void setDomainCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values.

Parameters:
flag - the flag.

getDomainCrosshairValue

public double getDomainCrosshairValue()
Returns the domain crosshair value.

Returns:
the value.

setDomainCrosshairValue

public void setDomainCrosshairValue(double value)
Sets the domain crosshair value.

Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.

Parameters:
value - the new value.

setDomainCrosshairValue

public void setDomainCrosshairValue(double value,
                                    boolean notify)
Sets the domain crosshair value.

Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.

Parameters:
value - the new value.
notify - a flag that controls whether or not listeners are notified.

getDomainCrosshairStroke

public java.awt.Stroke getDomainCrosshairStroke()
Returns the Stroke used to draw the crosshair (if visible).

Returns:
the crosshair stroke.

setDomainCrosshairStroke

public void setDomainCrosshairStroke(java.awt.Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
stroke - the new crosshair stroke.

getDomainCrosshairPaint

public java.awt.Paint getDomainCrosshairPaint()
Returns the domain crosshair color.

Returns:
the crosshair color.

setDomainCrosshairPaint

public void setDomainCrosshairPaint(java.awt.Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
paint - the new crosshair paint.

isRangeCrosshairVisible

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

Returns:
the flag.

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.

isRangeCrosshairLockedOnData

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

Returns:
the flag.

setRangeCrosshairLockedOnData

public void setRangeCrosshairLockedOnData(boolean flag)
Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.

Parameters:
flag - the flag.

getRangeCrosshairValue

public double getRangeCrosshairValue()
Returns the range crosshair value.

Returns:
The value.

setRangeCrosshairValue

public void setRangeCrosshairValue(double value)
Sets the domain crosshair value.

Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.

Parameters:
value - the new value.

setRangeCrosshairValue

public void setRangeCrosshairValue(double value,
                                   boolean notify)
Sets the range crosshair value.

Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.

Parameters:
value - the new value.
notify - a flag that controls whether or not listeners are notified.

getRangeCrosshairStroke

public java.awt.Stroke getRangeCrosshairStroke()
Returns the Stroke used to draw the crosshair (if visible).

Returns:
the crosshair stroke.

setRangeCrosshairStroke

public void setRangeCrosshairStroke(java.awt.Stroke stroke)
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
stroke - the new crosshair stroke.

getRangeCrosshairPaint

public java.awt.Paint getRangeCrosshairPaint()
Returns the range crosshair color.

Returns:
the crosshair color.

setRangeCrosshairPaint

public void setRangeCrosshairPaint(java.awt.Paint paint)
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified.

Parameters:
paint - the new crosshair paint.

getFixedDomainAxisSpace

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

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

setFixedDomainAxisSpace

public void setFixedDomainAxisSpace(AxisSpace space)
Sets the fixed domain axis space.

Parameters:
space - the space.

getFixedRangeAxisSpace

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

Returns:
The fixed range axis space.

setFixedRangeAxisSpace

public void setFixedRangeAxisSpace(AxisSpace space)
Sets the fixed range axis space.

Parameters:
space - the space.

zoomHorizontalAxes

public void zoomHorizontalAxes(double factor)
Multiplies the range on the horizontal axis/axes by the specified factor.

Specified by:
zoomHorizontalAxes in interface ValueAxisPlot
Parameters:
factor - the zoom factor.

zoomHorizontalAxes

public void zoomHorizontalAxes(double lowerPercent,
                               double upperPercent)
Zooms in on the horizontal axes.

Specified by:
zoomHorizontalAxes in interface ValueAxisPlot
Parameters:
lowerPercent - the lower bound.
upperPercent - the upper bound.

zoomVerticalAxes

public void zoomVerticalAxes(double factor)
Multiplies the range on the vertical axis/axes by the specified factor.

Specified by:
zoomVerticalAxes in interface ValueAxisPlot
Parameters:
factor - the zoom factor.

zoomVerticalAxes

public void zoomVerticalAxes(double lowerPercent,
                             double upperPercent)
Zooms in on the vertical axes.

Specified by:
zoomVerticalAxes in interface ValueAxisPlot
Parameters:
lowerPercent - the lower bound.
upperPercent - the upper bound.

getSeriesCount

public int getSeriesCount()
Returns the number of series in the primary dataset for this plot. If the dataset is null, the method returns 0.

Returns:
The series count.

getLegendItems

public LegendItemCollection getLegendItems()
Returns the legend items for the plot. Each legend item is generated by the plot's renderer, since the renderer is responsible for the visual representation of the data.

Overrides:
getLegendItems in class Plot
Returns:
the legend items.

equals

public boolean equals(java.lang.Object obj)
Tests this plot for equality with another object.

Overrides:
equals in class Plot
Parameters:
obj - the object.
Returns:
true or false.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the plot.

Overrides:
clone in class Plot
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - this can occur if some component of the plot cannot be cloned.