Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » plot » [javadoc | source]
org.jfree.chart.plot
public class: XYPlot [javadoc | source]
java.lang.Object
   org.jfree.chart.plot.Plot
      org.jfree.chart.plot.XYPlot

All Implemented Interfaces:
    PublicCloneable, ValueAxisPlot, Cloneable, RendererChangeListener, Zoomable, Serializable, AxisChangeListener, LegendItemSource, MarkerChangeListener, DatasetChangeListener

Direct Known Subclasses:
    CombinedDomainXYPlot, CombinedRangeXYPlot, CombinedXYPlot

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 org.jfree.chart.ChartFactory class contains static methods for creating pre-configured charts.
Field Summary
public static final  Stroke DEFAULT_GRIDLINE_STROKE    The default grid line stroke. 
public static final  Paint DEFAULT_GRIDLINE_PAINT    The default grid line paint. 
public static final  boolean DEFAULT_CROSSHAIR_VISIBLE    The default crosshair visibility. 
public static final  Stroke DEFAULT_CROSSHAIR_STROKE    The default crosshair stroke. 
public static final  Paint DEFAULT_CROSSHAIR_PAINT    The default crosshair paint. 
protected static  ResourceBundle localizationResources    The resourceBundle for the localization. 
Fields inherited from org.jfree.chart.plot.Plot:
ZERO,  DEFAULT_INSETS,  DEFAULT_OUTLINE_STROKE,  DEFAULT_OUTLINE_PAINT,  DEFAULT_FOREGROUND_ALPHA,  DEFAULT_BACKGROUND_ALPHA,  DEFAULT_BACKGROUND_PAINT,  MINIMUM_WIDTH_TO_DRAW,  MINIMUM_HEIGHT_TO_DRAW,  DEFAULT_LEGEND_ITEM_BOX,  DEFAULT_LEGEND_ITEM_CIRCLE
Constructor:
 public XYPlot() 
 public XYPlot(XYDataset dataset,
    ValueAxis domainAxis,
    ValueAxis rangeAxis,
    XYItemRenderer renderer) 
    Creates a new plot with the specified dataset, axes and renderer. Any of the arguments can be null, but in that case you should take care to specify the value before using the plot (otherwise a NullPointerException may be thrown).
    Parameters:
    dataset - the dataset (null permitted).
    domainAxis - the domain axis (null permitted).
    rangeAxis - the range axis (null permitted).
    renderer - the renderer (null permitted).
Method from org.jfree.chart.plot.XYPlot Summary:
addAnnotation,   addAnnotation,   addDomainMarker,   addDomainMarker,   addDomainMarker,   addDomainMarker,   addRangeMarker,   addRangeMarker,   addRangeMarker,   addRangeMarker,   calculateAxisSpace,   calculateDomainAxisSpace,   calculateRangeAxisSpace,   clearAnnotations,   clearDomainAxes,   clearDomainMarkers,   clearDomainMarkers,   clearRangeAxes,   clearRangeMarkers,   clearRangeMarkers,   clone,   configureDomainAxes,   configureRangeAxes,   datasetChanged,   draw,   drawAnnotations,   drawAxes,   drawBackground,   drawDomainCrosshair,   drawDomainGridlines,   drawDomainMarkers,   drawDomainTickBands,   drawHorizontalLine,   drawQuadrants,   drawRangeCrosshair,   drawRangeGridlines,   drawRangeMarkers,   drawRangeTickBands,   drawVerticalLine,   drawZeroDomainBaseline,   drawZeroRangeBaseline,   equals,   getAnnotations,   getAxisOffset,   getDataRange,   getDataset,   getDataset,   getDatasetCount,   getDatasetRenderingOrder,   getDomainAxis,   getDomainAxis,   getDomainAxisCount,   getDomainAxisEdge,   getDomainAxisEdge,   getDomainAxisForDataset,   getDomainAxisIndex,   getDomainAxisLocation,   getDomainAxisLocation,   getDomainCrosshairPaint,   getDomainCrosshairStroke,   getDomainCrosshairValue,   getDomainGridlinePaint,   getDomainGridlineStroke,   getDomainMarkers,   getDomainMarkers,   getDomainTickBandPaint,   getDomainZeroBaselinePaint,   getDomainZeroBaselineStroke,   getFixedDomainAxisSpace,   getFixedLegendItems,   getFixedRangeAxisSpace,   getIndexOf,   getLegendItems,   getOrientation,   getPlotType,   getQuadrantOrigin,   getQuadrantPaint,   getRangeAxis,   getRangeAxis,   getRangeAxisCount,   getRangeAxisEdge,   getRangeAxisEdge,   getRangeAxisForDataset,   getRangeAxisIndex,   getRangeAxisLocation,   getRangeAxisLocation,   getRangeCrosshairPaint,   getRangeCrosshairStroke,   getRangeCrosshairValue,   getRangeGridlinePaint,   getRangeGridlineStroke,   getRangeMarkers,   getRangeMarkers,   getRangeTickBandPaint,   getRangeZeroBaselinePaint,   getRangeZeroBaselineStroke,   getRenderer,   getRenderer,   getRendererForDataset,   getSeriesCount,   getSeriesRenderingOrder,   getWeight,   handleClick,   indexOf,   isDomainCrosshairLockedOnData,   isDomainCrosshairVisible,   isDomainGridlinesVisible,   isDomainZeroBaselineVisible,   isDomainZoomable,   isRangeCrosshairLockedOnData,   isRangeCrosshairVisible,   isRangeGridlinesVisible,   isRangeZeroBaselineVisible,   isRangeZoomable,   mapDatasetToDomainAxis,   mapDatasetToRangeAxis,   removeAnnotation,   removeAnnotation,   removeDomainMarker,   removeDomainMarker,   removeDomainMarker,   removeDomainMarker,   removeRangeMarker,   removeRangeMarker,   removeRangeMarker,   removeRangeMarker,   render,   rendererChanged,   setAxisOffset,   setDataset,   setDataset,   setDatasetRenderingOrder,   setDomainAxes,   setDomainAxis,   setDomainAxis,   setDomainAxis,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainAxisLocation,   setDomainCrosshairLockedOnData,   setDomainCrosshairPaint,   setDomainCrosshairStroke,   setDomainCrosshairValue,   setDomainCrosshairValue,   setDomainCrosshairVisible,   setDomainGridlinePaint,   setDomainGridlineStroke,   setDomainGridlinesVisible,   setDomainTickBandPaint,   setDomainZeroBaselinePaint,   setDomainZeroBaselineStroke,   setDomainZeroBaselineVisible,   setFixedDomainAxisSpace,   setFixedDomainAxisSpace,   setFixedLegendItems,   setFixedRangeAxisSpace,   setFixedRangeAxisSpace,   setOrientation,   setQuadrantOrigin,   setQuadrantPaint,   setRangeAxes,   setRangeAxis,   setRangeAxis,   setRangeAxis,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeAxisLocation,   setRangeCrosshairLockedOnData,   setRangeCrosshairPaint,   setRangeCrosshairStroke,   setRangeCrosshairValue,   setRangeCrosshairValue,   setRangeCrosshairVisible,   setRangeGridlinePaint,   setRangeGridlineStroke,   setRangeGridlinesVisible,   setRangeTickBandPaint,   setRangeZeroBaselinePaint,   setRangeZeroBaselineStroke,   setRangeZeroBaselineVisible,   setRenderer,   setRenderer,   setRenderer,   setRenderers,   setSeriesRenderingOrder,   setWeight,   zoomDomainAxes,   zoomDomainAxes,   zoomDomainAxes,   zoomRangeAxes,   zoomRangeAxes,   zoomRangeAxes
Methods from org.jfree.chart.plot.Plot:
addChangeListener,   axisChanged,   clone,   datasetChanged,   draw,   drawBackground,   drawBackgroundImage,   drawNoDataMessage,   drawOutline,   equals,   fillBackground,   fillBackground,   fireChangeEvent,   getBackgroundAlpha,   getBackgroundImage,   getBackgroundImageAlignment,   getBackgroundImageAlpha,   getBackgroundPaint,   getDatasetGroup,   getDrawingSupplier,   getForegroundAlpha,   getInsets,   getLegendItems,   getNoDataMessage,   getNoDataMessageFont,   getNoDataMessagePaint,   getOutlinePaint,   getOutlineStroke,   getParent,   getPlotType,   getRectX,   getRectY,   getRootPlot,   handleClick,   isOutlineVisible,   isSubplot,   markerChanged,   notifyListeners,   removeChangeListener,   resolveDomainAxisLocation,   resolveRangeAxisLocation,   setBackgroundAlpha,   setBackgroundImage,   setBackgroundImageAlignment,   setBackgroundImageAlpha,   setBackgroundPaint,   setDatasetGroup,   setDrawingSupplier,   setForegroundAlpha,   setInsets,   setInsets,   setNoDataMessage,   setNoDataMessageFont,   setNoDataMessagePaint,   setOutlinePaint,   setOutlineStroke,   setOutlineVisible,   setParent,   zoom
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.chart.plot.XYPlot Detail:
 public  void addAnnotation(XYAnnotation annotation) 
    Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners.
 public  void addAnnotation(XYAnnotation annotation,
    boolean notify) 
    Adds an annotation to the plot and, if requested, sends a PlotChangeEvent to all registered listeners.
 public  void addDomainMarker(Marker marker) 
    Adds a marker for 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 range axis, however this is entirely up to the renderer.

 public  void addDomainMarker(Marker marker,
    Layer layer) 
    Adds a marker for the domain axis in the specified layer 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.

 public  void addDomainMarker(int index,
    Marker marker,
    Layer layer) 
    Adds a marker for a specific dataset/renderer 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 (that the renderer is mapped to), however this is entirely up to the renderer.

 public  void addDomainMarker(int index,
    Marker marker,
    Layer layer,
    boolean notify) 
    Adds a marker for a specific dataset/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 the domain axis (that the renderer is mapped to), however this is entirely up to the renderer.

 public  void addRangeMarker(Marker marker) 
    Adds a marker for 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.

 public  void addRangeMarker(Marker marker,
    Layer layer) 
    Adds a marker for the range axis in the specified layer 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.

 public  void addRangeMarker(int index,
    Marker marker,
    Layer layer) 
    Adds a marker for a specific dataset/renderer 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.

 public  void addRangeMarker(int index,
    Marker marker,
    Layer layer,
    boolean notify) 
    Adds a marker for a specific dataset/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 the range axis, however this is entirely up to the renderer.

 protected AxisSpace calculateAxisSpace(Graphics2D g2,
    Rectangle2D plotArea) 
    Calculates the space required for all the axes in the plot.
 protected AxisSpace calculateDomainAxisSpace(Graphics2D g2,
    Rectangle2D plotArea,
    AxisSpace space) 
    Calculates the space required for the domain axis/axes.
 protected AxisSpace calculateRangeAxisSpace(Graphics2D g2,
    Rectangle2D plotArea,
    AxisSpace space) 
    Calculates the space required for the range axis/axes.
 public  void clearAnnotations() 
    Clears all the annotations and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainAxes() 
    Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainMarkers() 
    Clears all the (foreground and background) domain markers and sends a PlotChangeEvent to all registered listeners.
 public  void clearDomainMarkers(int index) 
    Clears the (foreground and background) domain markers for a particular renderer.
 public  void clearRangeAxes() 
    Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners.
 public  void clearRangeMarkers() 
    Clears all the range markers and sends a PlotChangeEvent to all registered listeners.
 public  void clearRangeMarkers(int index) 
    Clears the (foreground and background) range markers for a particular renderer.
 public Object clone() throws CloneNotSupportedException 
    Returns a clone of the plot.
 public  void configureDomainAxes() 
    Configures the domain axes.
 public  void configureRangeAxes() 
    Configures the range axes.
 public  void datasetChanged(DatasetChangeEvent event) 
    Receives notification of a change to the plot's dataset.

    The axis ranges are updated if necessary.

 public  void draw(Graphics2D g2,
    Rectangle2D area,
    Point2D anchor,
    PlotState parentState,
    PlotRenderingInfo info) 
    Draws the plot within the specified area on a graphics device.
 public  void drawAnnotations(Graphics2D g2,
    Rectangle2D dataArea,
    PlotRenderingInfo info) 
    Draws the annotations for the plot.
 protected Map drawAxes(Graphics2D g2,
    Rectangle2D plotArea,
    Rectangle2D dataArea,
    PlotRenderingInfo plotState) 
    A utility method for drawing the axes.
 public  void drawBackground(Graphics2D g2,
    Rectangle2D area) 
    Draws the background for the plot.
 protected  void drawDomainCrosshair(Graphics2D g2,
    Rectangle2D dataArea,
    PlotOrientation orientation,
    double value,
    ValueAxis axis,
    Stroke stroke,
    Paint paint) 
    Draws a domain crosshair.
 protected  void drawDomainGridlines(Graphics2D g2,
    Rectangle2D dataArea,
    List ticks) 
    Draws the gridlines for the plot, if they are visible.
 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.
 public  void drawDomainTickBands(Graphics2D g2,
    Rectangle2D dataArea,
    List ticks) 
    Draws the domain tick bands, if any.
 protected  void drawHorizontalLine(Graphics2D g2,
    Rectangle2D dataArea,
    double value,
    Stroke stroke,
    Paint paint) 
    Utility method for drawing a horizontal line across the data area of the plot.
 protected  void drawQuadrants(Graphics2D g2,
    Rectangle2D area) 
    Draws the quadrants.
 protected  void drawRangeCrosshair(Graphics2D g2,
    Rectangle2D dataArea,
    PlotOrientation orientation,
    double value,
    ValueAxis axis,
    Stroke stroke,
    Paint paint) 
    Draws a range crosshair.
 protected  void drawRangeGridlines(Graphics2D g2,
    Rectangle2D area,
    List ticks) 
    Draws the gridlines for the plot's primary range axis, if they are visible.
 protected  void drawRangeMarkers(Graphics2D g2,
    Rectangle2D dataArea,
    int index,
    Layer layer) 
    Draws the range markers (if any) for a renderer and layer. This method is typically called from within the draw() method.
 public  void drawRangeTickBands(Graphics2D g2,
    Rectangle2D dataArea,
    List ticks) 
    Draws the range tick bands, if any.
 protected  void drawVerticalLine(Graphics2D g2,
    Rectangle2D dataArea,
    double value,
    Stroke stroke,
    Paint paint) 
    Utility method for drawing a vertical line on the data area of the plot.
 protected  void drawZeroDomainBaseline(Graphics2D g2,
    Rectangle2D area) 
    Draws a base line across the chart at value zero on the domain axis.
 protected  void drawZeroRangeBaseline(Graphics2D g2,
    Rectangle2D area) 
    Draws a base line across the chart at value zero on the range axis.
 public boolean equals(Object obj) 
    Tests this plot for equality with another object.
 public List getAnnotations() 
    Returns the list of annotations.
 public RectangleInsets getAxisOffset() 
    Returns the axis offset.
 public Range getDataRange(ValueAxis axis) 
    Returns the range for the specified axis.
 public XYDataset getDataset() 
    Returns the primary dataset for the plot.
 public XYDataset getDataset(int index) 
    Returns a dataset.
 public int getDatasetCount() 
    Returns the number of datasets.
 public DatasetRenderingOrder getDatasetRenderingOrder() 
    Returns the dataset rendering order.
 public ValueAxis getDomainAxis() 
    Returns the domain axis with index 0. 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).
 public ValueAxis getDomainAxis(int index) 
    Returns the domain axis with the specified index, or null.
 public int getDomainAxisCount() 
    Returns the number of domain axes.
 public RectangleEdge getDomainAxisEdge() 
    Returns the edge for the primary domain axis (taking into account the plot's orientation).
 public RectangleEdge getDomainAxisEdge(int index) 
    Returns the edge for a domain axis.
 public ValueAxis getDomainAxisForDataset(int index) 
    Returns the domain axis for a dataset.
 public int getDomainAxisIndex(ValueAxis axis) 
    Returns the index of the given domain axis.
 public AxisLocation getDomainAxisLocation() 
    Returns the location of the primary domain axis.
 public AxisLocation getDomainAxisLocation(int index) 
    Returns the location for a domain axis. If this hasn't been set explicitly, the method returns the location that is opposite to the primary domain axis location.
 public Paint getDomainCrosshairPaint() 
    Returns the domain crosshair paint.
 public Stroke getDomainCrosshairStroke() 
    Returns the Stroke used to draw the crosshair (if visible).
 public double getDomainCrosshairValue() 
    Returns the domain crosshair value.
 public Paint getDomainGridlinePaint() 
    Returns the paint for the grid lines (if any) plotted against the domain axis.
 public Stroke getDomainGridlineStroke() 
    Returns the stroke for the grid-lines (if any) plotted against the domain axis.
 public Collection getDomainMarkers(Layer layer) 
    Returns the list of domain markers (read only) for the specified layer.
 public Collection getDomainMarkers(int index,
    Layer layer) 
    Returns a collection of domain markers for a particular renderer and layer.
 public Paint getDomainTickBandPaint() 
    Returns the paint used for the domain tick bands. If this is null, no tick bands will be drawn.
 public Paint getDomainZeroBaselinePaint() 
    Returns the paint for the zero baseline (if any) plotted against the domain axis.
 public Stroke getDomainZeroBaselineStroke() 
    Returns the stroke used for the zero baseline against the domain axis.
 public AxisSpace getFixedDomainAxisSpace() 
    Returns the fixed domain axis space.
 public LegendItemCollection getFixedLegendItems() 
    Returns the fixed legend items, if any.
 public AxisSpace getFixedRangeAxisSpace() 
    Returns the fixed range axis space.
 public int getIndexOf(XYItemRenderer renderer) 
    Returns the index of the specified renderer, or -1 if