- All Implemented Interfaces:
Disposable,Serializable,Cloneable,EventListener,AnnotationChangeListener,AxisChangeListener,MarkerChangeListener,RendererChangeListener,LegendItemSource,Pannable,ValueAxisPlot,Zoomable,PublicCloneable,DatasetChangeListener
- Direct Known Subclasses:
CombinedDomainXYPlot,CombinedRangeXYPlot
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PaintThe default crosshair paint.static final StrokeThe default crosshair stroke.static final booleanThe default crosshair visibility.static final PaintThe default grid line paint.static final StrokeThe default grid line stroke.protected static ResourceBundleThe resourceBundle for the localization.Fields inherited from class org.jfree.chart.plot.Plot
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnnotation(XYAnnotation annotation) Adds an annotation to the plot and sends aPlotChangeEventto all registered listeners.voidaddAnnotation(XYAnnotation annotation, boolean notify) Adds an annotation to the plot and, if requested, sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(int index, Marker marker, Layer layer) Adds a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(int index, Marker marker, Layer layer, boolean notify) Adds a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(Marker marker) Adds a marker for the domain axis and sends aPlotChangeEventto all registered listeners.voidaddDomainMarker(Marker marker, Layer layer) Adds a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(int index, Marker marker, Layer layer) Adds a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(int index, Marker marker, Layer layer, boolean notify) Adds a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(Marker marker) Adds a marker for the range axis and sends aPlotChangeEventto all registered listeners.voidaddRangeMarker(Marker marker, Layer layer) Adds a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.voidReceives notification of a change to anAnnotationadded to this plot.protected AxisSpacecalculateAxisSpace(Graphics2D g2, Rectangle2D plotArea) Calculates the space required for all the axes in the plot.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.voidClears all the annotations and sends aPlotChangeEventto all registered listeners.voidClears the domain axes from the plot and sends aPlotChangeEventto all registered listeners.voidClears all the (foreground and background) domain markers and sends aPlotChangeEventto all registered listeners.voidclearDomainMarkers(int index) Clears the (foreground and background) domain markers for a particular renderer and sends aPlotChangeEventto all registered listeners.voidClears the range axes from the plot and sends aPlotChangeEventto all registered listeners.voidClears all the range markers and sends aPlotChangeEventto all registered listeners.voidclearRangeMarkers(int index) Clears the (foreground and background) range markers for a particular renderer.clone()Returns a clone of the plot.voidConfigures the domain axes.voidConfigures the range axes.voiddatasetChanged(DatasetChangeEvent event) Receives notification of a change to the plot's dataset.voiddispose()voiddraw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) Draws the plot within the specified area on a graphics device.voiddrawAnnotations(Graphics2D g2, Rectangle2D dataArea, PlotRenderingInfo info) Draws the annotations for the plot.drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState) A utility method for drawing the axes.voiddrawBackground(Graphics2D g2, Rectangle2D area) Draws the background for the plot.protected voiddrawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) Draws a domain crosshair.protected voiddrawDomainGridlines(Graphics2D g2, Rectangle2D dataArea, List ticks) Draws the gridlines for the plot, if they are visible.protected voiddrawDomainMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) Draws the domain markers (if any) for an axis and layer.voiddrawDomainTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) Draws the domain tick bands, if any.protected voiddrawHorizontalLine(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 voiddrawQuadrants(Graphics2D g2, Rectangle2D area) Draws the quadrants.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 area, List ticks) Draws the gridlines for the plot's primary range axis, if they are visible.protected voiddrawRangeMarkers(Graphics2D g2, Rectangle2D dataArea, int index, Layer layer) Draws the range markers (if any) for a renderer and layer.voiddrawRangeTickBands(Graphics2D g2, Rectangle2D dataArea, List ticks) Draws the range tick bands, if any.protected voiddrawVerticalLine(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 voiddrawZeroDomainBaseline(Graphics2D g2, Rectangle2D area) Draws a base line across the chart at value zero on the domain axis.protected voiddrawZeroRangeBaseline(Graphics2D g2, Rectangle2D area) Draws a base line across the chart at value zero on the range axis.booleanTests this plot for equality with another object.Returns the list of annotations.Returns the axis offset.getDataRange(ValueAxis axis) Returns the range for the specified axis.Returns the primary dataset for the plot.getDataset(int index) Returns the dataset with the specified index, ornullif there is no dataset with that index.intReturns the number of datasets.Returns the dataset rendering order.Returns the domain axis with index 0.getDomainAxis(int index) Returns the domain axis with the specified index, ornullif there is no axis with that index.intReturns the number of domain axes.Returns the edge for the primary domain axis (taking into account the plot's orientation).getDomainAxisEdge(int index) Returns the edge for a domain axis.getDomainAxisForDataset(int index) Returns the domain axis for a dataset.intgetDomainAxisIndex(ValueAxis axis) Returns the index of the given domain axis.Returns the location of the primary domain axis.getDomainAxisLocation(int index) Returns the location for a domain axis.Returns the domain crosshair paint.Returns theStrokeused to draw the crosshair (if visible).doubleReturns the domain crosshair value.Returns the paint for the grid lines (if any) plotted against the domain axis.Returns the stroke for the grid-lines (if any) plotted against the domain axis.getDomainMarkers(int index, Layer layer) Returns a collection of domain markers for a particular renderer and layer.getDomainMarkers(Layer layer) Returns the list of domain markers (read only) for the specified layer.Returns the paint for the minor grid lines (if any) plotted against the domain axis.Returns the stroke for the minor grid-lines (if any) plotted against the domain axis.Returns the paint used for the domain tick bands.Returns the paint for the zero baseline (if any) plotted against the domain axis.Returns the stroke used for the zero baseline against the domain axis.Returns the fixed domain axis space.Returns the fixed legend items, if any.Returns the fixed range axis space.intgetIndexOf(XYItemRenderer renderer) Returns the index of the specified renderer, or-1if the renderer is not assigned to this plot.Returns the legend items for the plot.Returns the orientation of the plot.Returns the plot type as a string.Returns the origin for the quadrants that can be displayed on the plot.getQuadrantPaint(int index) Returns the paint used for the specified quadrant.Returns the range axis for the plot.getRangeAxis(int index) Returns the range axis with the specified index, ornullif there is no axis with that index.intReturns the number of range axes.Returns the edge for the primary range axis.getRangeAxisEdge(int index) Returns the edge for a range axis.getRangeAxisForDataset(int index) Returns the range axis for a dataset.intgetRangeAxisIndex(ValueAxis axis) Returns the index of the given range axis.Returns the location of the primary range axis.getRangeAxisLocation(int index) Returns the location for a range axis.Returns the range crosshair paint.Returns the stroke used to draw the crosshair (if visible).doubleReturns the range crosshair value.Returns the paint for the grid lines (if any) plotted against the range axis.Returns the stroke for the grid lines (if any) plotted against the range axis.getRangeMarkers(int index, Layer layer) Returns a collection of range markers for a particular renderer and layer.getRangeMarkers(Layer layer) Returns the list of range markers (read only) for the specified layer.Returns the paint for the minor grid lines (if any) plotted against the range axis.Returns the stroke for the minor grid lines (if any) plotted against the range axis.Returns the paint used for the range tick bands.Returns the paint for the zero baseline (if any) plotted against the range axis.Returns the stroke used for the zero baseline against the range axis.Returns the renderer for the primary dataset.getRenderer(int index) Returns the renderer with the specified index, ornull.intReturns the number of renderer slots for this plot.getRendererForDataset(XYDataset dataset) Returns the renderer for the specified dataset (this is either the renderer with the same index as the dataset or, if there isn't a renderer with the same index, the default renderer).intReturns the number of series in the primary dataset for this plot.Returns the series rendering order.Returns the shadow generator for the plot, if any.intReturns the weight for this plot when it is used as a subplot within a combined plot.voidhandleClick(int x, int y, PlotRenderingInfo info) Handles a 'click' on the plot by updating the anchor values.intReturns the index of the specified dataset, or-1if the dataset does not belong to the plot.booleanReturns a flag indicating whether or not the crosshair should "lock-on" to actual data values.booleanReturns a flag indicating whether or not the domain crosshair is visible.booleanReturnstrueif the domain gridlines are visible, andfalseotherwise.booleanReturnstrueif the domain minor gridlines are visible, andfalseotherwise.booleanReturnstrueif panning is enabled for the domain axes, andfalseotherwise.booleanReturns a flag that controls whether or not a zero baseline is displayed for the domain axis.booleanReturnstrue, indicating that the domain axis/axes for this plot are zoomable.booleanReturns a flag indicating whether or not the crosshair should "lock-on" to actual data values.booleanReturns a flag indicating whether or not the range crosshair is visible.booleanReturnstrueif the range axis grid is visible, andfalseotherwise.booleanReturnstrueif the range axis minor grid is visible, andfalseotherwise.booleanReturnstrueif panning is enabled for the range axis/axes, andfalseotherwise.booleanReturns a flag that controls whether or not a zero baseline is displayed for the range axis.booleanReturnstrue, indicating that the range axis/axes for this plot are zoomable.voidmapDatasetToDomainAxes(int index, List axisIndices) Maps the specified dataset to the axes in the list.voidmapDatasetToDomainAxis(int index, int axisIndex) Maps a dataset to a particular domain axis.voidmapDatasetToRangeAxes(int index, List axisIndices) Maps the specified dataset to the axes in the list.voidmapDatasetToRangeAxis(int index, int axisIndex) Maps a dataset to a particular range axis.voidpanDomainAxes(double percent, PlotRenderingInfo info, Point2D source) Pans the domain axes by the specified percentage.voidpanRangeAxes(double percent, PlotRenderingInfo info, Point2D source) Pans the range axes by the specified percentage.booleanremoveAnnotation(XYAnnotation annotation) Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.booleanremoveAnnotation(XYAnnotation annotation, boolean notify) Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(int index, Marker marker, Layer layer) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(int index, Marker marker, Layer layer, boolean notify) Removes a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(Marker marker) Removes a marker for the domain axis and sends aPlotChangeEventto all registered listeners.booleanremoveDomainMarker(Marker marker, Layer layer) Removes a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(int index, Marker marker, Layer layer) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(int index, Marker marker, Layer layer, boolean notify) Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(Marker marker) Removes a marker for the range axis and sends aPlotChangeEventto all registered listeners.booleanremoveRangeMarker(Marker marker, Layer layer) Removes a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.booleanrender(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState) Draws a representation of the data within the dataArea region, using the current renderer.voidReceives notification of a renderer change event.voidsetAxisOffset(RectangleInsets offset) Sets the axis offsets (gap between the data area and the axes) and sends aPlotChangeEventto all registered listeners.voidsetDataset(int index, XYDataset dataset) Sets a dataset for the plot and sends a change event to all registered listeners.voidsetDataset(XYDataset dataset) Sets the primary dataset for the plot, replacing the existing dataset if there is one.voidSets the rendering order and sends aPlotChangeEventto all registered listeners.voidsetDomainAxes(ValueAxis[] axes) Sets the domain axes for this plot and sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(int index, ValueAxis axis) Sets a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(int index, ValueAxis axis, boolean notify) Sets a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDomainAxis(ValueAxis axis) Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(int index, AxisLocation location) Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(int index, AxisLocation location, boolean notify) Sets the axis location for a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location) Sets the location of the primary domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainAxisLocation(AxisLocation location, boolean notify) Sets the location of the domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetDomainCrosshairLockedOnData(boolean flag) Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values.voidsetDomainCrosshairPaint(Paint paint) Sets the paint used to draw the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.voidsetDomainCrosshairStroke(Stroke stroke) Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified.voidsetDomainCrosshairValue(double value) Sets the domain crosshair value and sends aPlotChangeEventto all registered listeners (provided that the domain crosshair is visible).voidsetDomainCrosshairValue(double value, boolean notify) Sets the domain crosshair value and, if requested, sends aPlotChangeEventto all registered listeners (provided that the domain crosshair is visible).voidsetDomainCrosshairVisible(boolean flag) Sets the flag indicating whether or not the domain crosshair is visible and, if the flag changes, sends aPlotChangeEventto all registered listeners.voidsetDomainGridlinePaint(Paint paint) Sets the paint for the grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlineStroke(Stroke stroke) Sets the stroke for the grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetDomainGridlinesVisible(boolean visible) Sets the flag that controls whether or not the domain grid-lines are visible.voidsetDomainMinorGridlinePaint(Paint paint) Sets the paint for the minor grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetDomainMinorGridlineStroke(Stroke stroke) Sets the stroke for the minor grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetDomainMinorGridlinesVisible(boolean visible) Sets the flag that controls whether or not the domain minor grid-lines are visible.voidsetDomainPannable(boolean pannable) Sets the flag that enables or disables panning of the plot along the domain axes.voidsetDomainTickBandPaint(Paint paint) Sets the paint for the domain tick bands.voidsetDomainZeroBaselinePaint(Paint paint) Sets the paint for the zero baseline plotted against the domain axis and sends aPlotChangeEventto all registered listeners.voidsetDomainZeroBaselineStroke(Stroke stroke) Sets the stroke for the zero baseline for the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetDomainZeroBaselineVisible(boolean visible) Sets the flag that controls whether or not the zero baseline is displayed for the domain axis, and sends aPlotChangeEventto all registered listeners.voidsetFixedDomainAxisSpace(AxisSpace space) Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.voidsetFixedDomainAxisSpace(AxisSpace space, boolean notify) Sets the fixed domain axis space and, if requested, sends aPlotChangeEventto all registered listeners.voidSets the fixed legend items for the plot.voidsetFixedRangeAxisSpace(AxisSpace space) Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.voidsetFixedRangeAxisSpace(AxisSpace space, boolean notify) Sets the fixed range axis space and, if requested, sends aPlotChangeEventto all registered listeners.voidsetOrientation(PlotOrientation orientation) Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.voidsetQuadrantOrigin(Point2D origin) Sets the quadrant origin and sends aPlotChangeEventto all registered listeners.voidsetQuadrantPaint(int index, Paint paint) Sets the paint used for the specified quadrant and sends aPlotChangeEventto all registered listeners.voidsetRangeAxes(ValueAxis[] axes) Sets the range axes for this plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(int index, ValueAxis axis) Sets a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(int index, ValueAxis axis, boolean notify) Sets a range axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeAxis(ValueAxis axis) Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location) Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(int index, AxisLocation location, boolean notify) Sets the axis location for a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location) Sets the location of the primary range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeAxisLocation(AxisLocation location, boolean notify) Sets the location of the primary range axis and, if requested, sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairLockedOnData(boolean flag) Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values.voidsetRangeCrosshairPaint(Paint paint) Sets the paint used to color the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairStroke(Stroke stroke) Sets the stroke used to draw the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.voidsetRangeCrosshairValue(double value) Sets the range crosshair value.voidsetRangeCrosshairValue(double value, boolean notify) Sets the range crosshair value and sends aPlotChangeEventto all registered listeners, but only if the crosshair is visible.voidsetRangeCrosshairVisible(boolean flag) Sets the flag indicating whether or not the range crosshair is visible.voidsetRangeGridlinePaint(Paint paint) Sets the paint for the grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeGridlineStroke(Stroke stroke) Sets the stroke for the grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRangeGridlinesVisible(boolean visible) Sets the flag that controls whether or not the range axis grid lines are visible.voidsetRangeMinorGridlinePaint(Paint paint) Sets the paint for the minor grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeMinorGridlineStroke(Stroke stroke) Sets the stroke for the minor grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRangeMinorGridlinesVisible(boolean visible) Sets the flag that controls whether or not the range axis minor grid lines are visible.voidsetRangePannable(boolean pannable) Sets the flag that enables or disables panning of the plot along the range axis/axes.voidsetRangeTickBandPaint(Paint paint) Sets the paint for the range tick bands.voidsetRangeZeroBaselinePaint(Paint paint) Sets the paint for the zero baseline plotted against the range axis and sends aPlotChangeEventto all registered listeners.voidsetRangeZeroBaselineStroke(Stroke stroke) Sets the stroke for the zero baseline for the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRangeZeroBaselineVisible(boolean visible) Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends aPlotChangeEventto all registered listeners.voidsetRenderer(int index, XYItemRenderer renderer) Sets the renderer for the dataset with the specified index and sends a change event to all registered listeners.voidsetRenderer(int index, XYItemRenderer renderer, boolean notify) Sets the renderer for the dataset with the specified index and, if requested, sends a change event to all registered listeners.voidsetRenderer(XYItemRenderer renderer) Sets the renderer for the primary dataset and sends a change event to all registered listeners.voidsetRenderers(XYItemRenderer[] renderers) Sets the renderers for this plot and sends aPlotChangeEventto all registered listeners.voidSets the series order and sends aPlotChangeEventto all registered listeners.voidsetShadowGenerator(ShadowGenerator generator) Sets the shadow generator for the plot and sends aPlotChangeEventto all registered listeners.voidsetWeight(int weight) Sets the weight for the plot and sends aPlotChangeEventto all registered listeners.voidzoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) Zooms in on the domain axis/axes.voidzoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source) Multiplies the range on the domain axis/axes by the specified factor.voidzoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) Multiplies the range on the domain axis/axes by the specified factor.voidzoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) Zooms in on the range axes.voidzoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source) Multiplies the range on the range axis/axes by the specified factor.voidzoomRangeAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) Multiplies the range on the range axis/axes by the specified factor.Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, axisChanged, createAndAddEntity, drawBackgroundImage, drawNoDataMessage, drawOutline, fetchElementHintingFlag, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getChart, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRectX, getRectY, getRootPlot, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setChart, setDatasetGroup, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom
-
Field Details
-
DEFAULT_GRIDLINE_STROKE
The default grid line stroke. -
DEFAULT_GRIDLINE_PAINT
The default grid line paint. -
DEFAULT_CROSSHAIR_VISIBLE
public static final boolean DEFAULT_CROSSHAIR_VISIBLEThe default crosshair visibility.- See Also:
-
DEFAULT_CROSSHAIR_STROKE
The default crosshair stroke. -
DEFAULT_CROSSHAIR_PAINT
The default crosshair paint. -
localizationResources
The resourceBundle for the localization.
-
-
Constructor Details
-
XYPlot
public XYPlot()Creates a newXYPlotinstance with no dataset, no axes and no renderer. You should specify these items before using the plot. -
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 benull, but in that case you should take care to specify the value before using the plot (otherwise aNullPointerExceptionmay be thrown).- Parameters:
dataset- the dataset (nullpermitted).domainAxis- the domain axis (nullpermitted).rangeAxis- the range axis (nullpermitted).renderer- the renderer (nullpermitted).
-
-
Method Details
-
getPlotType
Returns the plot type as a string.- Specified by:
getPlotTypein classPlot- Returns:
- A short string describing the type of plot.
-
getOrientation
Returns the orientation of the plot.- Specified by:
getOrientationin interfacePannable- Specified by:
getOrientationin interfaceZoomable- Returns:
- The orientation (never
null). - See Also:
-
setOrientation
Sets the orientation for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
orientation- the orientation (nullnot allowed).- See Also:
-
getAxisOffset
Returns the axis offset.- Returns:
- The axis offset (never
null). - See Also:
-
setAxisOffset
Sets the axis offsets (gap between the data area and the axes) and sends aPlotChangeEventto all registered listeners.- Parameters:
offset- the offset (nullnot permitted).- See Also:
-
getDomainAxis
Returns the domain axis with index 0. If the domain axis for this plot isnull, then the method will return the parent plot's domain axis (if there is a parent plot).- Returns:
- The domain axis (possibly
null). - See Also:
-
getDomainAxis
Returns the domain axis with the specified index, ornullif there is no axis with that index.- Parameters:
index- the axis index.- Returns:
- The axis (
nullpossible). - See Also:
-
setDomainAxis
Sets the domain axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the new axis (nullpermitted).- See Also:
-
setDomainAxis
Sets a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis (nullpermitted).- See Also:
-
setDomainAxis
Sets a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis.notify- notify listeners?- See Also:
-
setDomainAxes
Sets the domain axes for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axes- the axes (nullnot permitted).- See Also:
-
getDomainAxisLocation
Returns the location of the primary domain axis.- Returns:
- The location (never
null). - See Also:
-
setDomainAxisLocation
Sets the location of the primary domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).- See Also:
-
setDomainAxisLocation
Sets the location of the domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).notify- notify listeners?- See Also:
-
getDomainAxisEdge
Returns the edge for the primary domain axis (taking into account the plot's orientation).- Returns:
- The edge.
- See Also:
-
getDomainAxisCount
public int getDomainAxisCount()Returns the number of domain axes.- Returns:
- The axis count.
- See Also:
-
clearDomainAxes
public void clearDomainAxes()Clears the domain axes from the plot and sends aPlotChangeEventto all registered listeners.- See Also:
-
configureDomainAxes
public void configureDomainAxes()Configures the domain axes. -
getDomainAxisLocation
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.- Parameters:
index- the axis index (must be >= 0).- Returns:
- The location (never
null). - See Also:
-
setDomainAxisLocation
Sets the location for a domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location (nullnot permitted for index 0).- See Also:
-
setDomainAxisLocation
Sets the axis location for a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index (must be >= 0).location- the location (nullnot permitted for index 0).notify- notify listeners?- See Also:
-
getDomainAxisEdge
Returns the edge for a domain axis.- Parameters:
index- the axis index.- Returns:
- The edge.
- See Also:
-
getRangeAxis
Returns the range axis for the plot. If the range axis for this plot isnull, then the method will return the parent plot's range axis (if there is a parent plot).- Returns:
- The range axis.
- See Also:
-
setRangeAxis
Sets the range axis for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axis- the axis (nullpermitted).- See Also:
-
getRangeAxisLocation
Returns the location of the primary range axis.- Returns:
- The location (never
null). - See Also:
-
setRangeAxisLocation
Sets the location of the primary range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).- See Also:
-
setRangeAxisLocation
Sets the location of the primary range axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
location- the location (nullnot permitted).notify- notify listeners?- See Also:
-
getRangeAxisEdge
Returns the edge for the primary range axis.- Returns:
- The range axis edge.
- See Also:
-
getRangeAxis
Returns the range axis with the specified index, ornullif there is no axis with that index.- Parameters:
index- the axis index (must be >= 0).- Returns:
- The axis (
nullpossible). - See Also:
-
setRangeAxis
Sets a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis (nullpermitted).- See Also:
-
setRangeAxis
Sets a range axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.axis- the axis (nullpermitted).notify- notify listeners?- See Also:
-
setRangeAxes
Sets the range axes for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
axes- the axes (nullnot permitted).- See Also:
-
getRangeAxisCount
public int getRangeAxisCount()Returns the number of range axes.- Returns:
- The axis count.
- See Also:
-
clearRangeAxes
public void clearRangeAxes()Clears the range axes from the plot and sends aPlotChangeEventto all registered listeners.- See Also:
-
configureRangeAxes
public void configureRangeAxes()Configures the range axes.- See Also:
-
getRangeAxisLocation
Returns the location for a range axis. If this hasn't been set explicitly, the method returns the location that is opposite to the primary range axis location.- Parameters:
index- the axis index (must be >= 0).- Returns:
- The location (never
null). - See Also:
-
setRangeAxisLocation
Sets the location for a range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location (nullpermitted).- See Also:
-
setRangeAxisLocation
Sets the axis location for a domain axis and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the axis index.location- the location (nullnot permitted for index 0).notify- notify listeners?- See Also:
-
getRangeAxisEdge
Returns the edge for a range axis.- Parameters:
index- the axis index.- Returns:
- The edge.
- See Also:
-
getDataset
Returns the primary dataset for the plot.- Returns:
- The primary dataset (possibly
null). - See Also:
-
getDataset
Returns the dataset with the specified index, ornullif there is no dataset with that index.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The dataset (possibly
null). - See Also:
-
setDataset
Sets the primary dataset for the plot, replacing the existing dataset if there is one.- Parameters:
dataset- the dataset (nullpermitted).- See Also:
-
setDataset
Sets a dataset for the plot and sends a change event to all registered listeners.- Parameters:
index- the dataset index (must be >= 0).dataset- the dataset (nullpermitted).- See Also:
-
getDatasetCount
public int getDatasetCount()Returns the number of datasets.- Returns:
- The number of datasets.
-
indexOf
Returns the index of the specified dataset, or-1if the dataset does not belong to the plot.- Parameters:
dataset- the dataset (nullnot permitted).- Returns:
- The index or -1.
-
mapDatasetToDomainAxis
public void mapDatasetToDomainAxis(int index, int axisIndex) Maps a dataset to a particular domain axis. All data will be plotted against axis zero by default, no mapping is required for this case.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index.- See Also:
-
mapDatasetToDomainAxes
Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.- Parameters:
index- the dataset index (zero-based).axisIndices- the axis indices (nullpermitted).
-
mapDatasetToRangeAxis
public void mapDatasetToRangeAxis(int index, int axisIndex) Maps a dataset to a particular range axis. All data will be plotted against axis zero by default, no mapping is required for this case.- Parameters:
index- the dataset index (zero-based).axisIndex- the axis index.- See Also:
-
mapDatasetToRangeAxes
Maps the specified dataset to the axes in the list. Note that the conversion of data values into Java2D space is always performed using the first axis in the list.- Parameters:
index- the dataset index (zero-based).axisIndices- the axis indices (nullpermitted).
-
getRendererCount
public int getRendererCount()Returns the number of renderer slots for this plot.- Returns:
- The number of renderer slots.
-
getRenderer
Returns the renderer for the primary dataset.- Returns:
- The item renderer (possibly
null). - See Also:
-
getRenderer
Returns the renderer with the specified index, ornull.- Parameters:
index- the renderer index (must be >= 0).- Returns:
- The renderer (possibly
null). - See Also:
-
setRenderer
Sets the renderer for the primary dataset and sends a change event to all registered listeners. If the renderer is set tonull, no data will be displayed.- Parameters:
renderer- the renderer (nullpermitted).- See Also:
-
setRenderer
Sets the renderer for the dataset with the specified index and sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.- Parameters:
index- the index (must be >= 0).renderer- the renderer.- See Also:
-
setRenderer
Sets the renderer for the dataset with the specified index and, if requested, sends a change event to all registered listeners. Note that each dataset should have its own renderer, you should not use one renderer for multiple datasets.- Parameters:
index- the index (must be >= 0).renderer- the renderer.notify- notify listeners?- See Also:
-
setRenderers
Sets the renderers for this plot and sends aPlotChangeEventto all registered listeners.- Parameters:
renderers- the renderers (nullnot permitted).
-
getDatasetRenderingOrder
Returns the dataset rendering order.- Returns:
- The order (never
null). - See Also:
-
setDatasetRenderingOrder
Sets the rendering order and sends aPlotChangeEventto all registered listeners. By default, the plot renders the primary dataset last (so that the primary dataset overlays the secondary datasets). You can reverse this if you want to.- Parameters:
order- the rendering order (nullnot permitted).- See Also:
-
getSeriesRenderingOrder
Returns the series rendering order.- Returns:
- the order (never
null). - See Also:
-
setSeriesRenderingOrder
Sets the series order and sends aPlotChangeEventto all registered listeners. By default, the plot renders the primary series last (so that the primary series appears to be on top). You can reverse this if you want to.- Parameters:
order- the rendering order (nullnot permitted).- See Also:
-
getIndexOf
Returns the index of the specified renderer, or-1if the renderer is not assigned to this plot.- Parameters:
renderer- the renderer (nullpermitted).- Returns:
- The renderer index.
-
getRendererForDataset
Returns the renderer for the specified dataset (this is either the renderer with the same index as the dataset or, if there isn't a renderer with the same index, the default renderer). If the dataset does not belong to the plot, this method will returnnull.- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The renderer (possibly
null).
-
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:
-
setWeight
public void setWeight(int weight) Sets the weight for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
weight- the weight.- See Also:
-
isDomainGridlinesVisible
public boolean isDomainGridlinesVisible()Returnstrueif the domain gridlines are visible, andfalseotherwise.- Returns:
trueorfalse.- See Also:
-
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
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
isDomainMinorGridlinesVisible
public boolean isDomainMinorGridlinesVisible()Returnstrueif the domain minor gridlines are visible, andfalseotherwise.- Returns:
trueorfalse.- See Also:
-
setDomainMinorGridlinesVisible
public void setDomainMinorGridlinesVisible(boolean visible) Sets the flag that controls whether or not the domain minor grid-lines are visible.If the flag value is changed, a
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getDomainGridlineStroke
Returns the stroke for the grid-lines (if any) plotted against the domain axis.- Returns:
- The stroke (never
null). - See Also:
-
setDomainGridlineStroke
Sets the stroke for the grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- Throws:
IllegalArgumentException- ifstrokeisnull.- See Also:
-
getDomainMinorGridlineStroke
Returns the stroke for the minor grid-lines (if any) plotted against the domain axis.- Returns:
- The stroke (never
null). - See Also:
-
setDomainMinorGridlineStroke
Sets the stroke for the minor grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- Throws:
IllegalArgumentException- ifstrokeisnull.- See Also:
-
getDomainGridlinePaint
Returns the paint for the grid lines (if any) plotted against the domain axis.- Returns:
- The paint (never
null). - See Also:
-
setDomainGridlinePaint
Sets the paint for the grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- Throws:
IllegalArgumentException- ifPaintisnull.- See Also:
-
getDomainMinorGridlinePaint
Returns the paint for the minor grid lines (if any) plotted against the domain axis.- Returns:
- The paint (never
null). - See Also:
-
setDomainMinorGridlinePaint
Sets the paint for the minor grid lines plotted against the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- Throws:
IllegalArgumentException- ifPaintisnull.- See Also:
-
isRangeGridlinesVisible
public boolean isRangeGridlinesVisible()Returnstrueif the range axis grid is visible, andfalseotherwise.- Returns:
- A boolean.
- See Also:
-
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
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getRangeGridlineStroke
Returns the stroke for the grid lines (if any) plotted against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeGridlineStroke
Sets the stroke for the grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeGridlinePaint
Returns the paint for the grid lines (if any) plotted against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeGridlinePaint
Sets the paint for the grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isRangeMinorGridlinesVisible
public boolean isRangeMinorGridlinesVisible()Returnstrueif the range axis minor grid is visible, andfalseotherwise.- Returns:
- A boolean.
- See Also:
-
setRangeMinorGridlinesVisible
public void setRangeMinorGridlinesVisible(boolean visible) Sets the flag that controls whether or not the range axis minor grid lines are visible.If the flag value is changed, a
PlotChangeEventis sent to all registered listeners.- Parameters:
visible- the new value of the flag.- See Also:
-
getRangeMinorGridlineStroke
Returns the stroke for the minor grid lines (if any) plotted against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeMinorGridlineStroke
Sets the stroke for the minor grid lines plotted against the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeMinorGridlinePaint
Returns the paint for the minor grid lines (if any) plotted against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeMinorGridlinePaint
Sets the paint for the minor grid lines plotted against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isDomainZeroBaselineVisible
public boolean isDomainZeroBaselineVisible()Returns a flag that controls whether or not a zero baseline is displayed for the domain axis.- Returns:
- A boolean.
- See Also:
-
setDomainZeroBaselineVisible
public void setDomainZeroBaselineVisible(boolean visible) Sets the flag that controls whether or not the zero baseline is displayed for the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
-
getDomainZeroBaselineStroke
Returns the stroke used for the zero baseline against the domain axis.- Returns:
- The stroke (never
null). - See Also:
-
setDomainZeroBaselineStroke
Sets the stroke for the zero baseline for the domain axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getDomainZeroBaselinePaint
Returns the paint for the zero baseline (if any) plotted against the domain axis.- Returns:
- The paint (never
null). - See Also:
-
setDomainZeroBaselinePaint
Sets the paint for the zero baseline plotted against the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
isRangeZeroBaselineVisible
public boolean isRangeZeroBaselineVisible()Returns a flag that controls whether or not a zero baseline is displayed for the range axis.- Returns:
- A boolean.
- See Also:
-
setRangeZeroBaselineVisible
public void setRangeZeroBaselineVisible(boolean visible) Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
visible- the flag.- See Also:
-
getRangeZeroBaselineStroke
Returns the stroke used for the zero baseline against the range axis.- Returns:
- The stroke (never
null). - See Also:
-
setRangeZeroBaselineStroke
Sets the stroke for the zero baseline for the range axis, and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
-
getRangeZeroBaselinePaint
Returns the paint for the zero baseline (if any) plotted against the range axis.- Returns:
- The paint (never
null). - See Also:
-
setRangeZeroBaselinePaint
Sets the paint for the zero baseline plotted against the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
-
getDomainTickBandPaint
Returns the paint used for the domain tick bands. If this isnull, no tick bands will be drawn.- Returns:
- The paint (possibly
null). - See Also:
-
setDomainTickBandPaint
Sets the paint for the domain tick bands.- Parameters:
paint- the paint (nullpermitted).- See Also:
-
getRangeTickBandPaint
Returns the paint used for the range tick bands. If this isnull, no tick bands will be drawn.- Returns:
- The paint (possibly
null). - See Also:
-
setRangeTickBandPaint
Sets the paint for the range tick bands.- Parameters:
paint- the paint (nullpermitted).- See Also:
-
getQuadrantOrigin
Returns the origin for the quadrants that can be displayed on the plot. This defaults to (0, 0).- Returns:
- The origin point (never
null). - See Also:
-
setQuadrantOrigin
Sets the quadrant origin and sends aPlotChangeEventto all registered listeners.- Parameters:
origin- the origin (nullnot permitted).- See Also:
-
getQuadrantPaint
Returns the paint used for the specified quadrant.- Parameters:
index- the quadrant index (0-3).- Returns:
- The paint (possibly
null). - See Also:
-
setQuadrantPaint
Sets the paint used for the specified quadrant and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the quadrant index (0-3).paint- the paint (nullpermitted).- See Also:
-
addDomainMarker
Adds a marker for the domain axis and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
- Parameters:
marker- the marker (nullnot permitted).- See Also:
-
addDomainMarker
Adds a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the domain axis, however this is entirely up to the renderer.
- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- See Also:
-
clearDomainMarkers
public void clearDomainMarkers()Clears all the (foreground and background) domain markers and sends aPlotChangeEventto all registered listeners.- See Also:
-
clearDomainMarkers
public void clearDomainMarkers(int index) Clears the (foreground and background) domain markers for a particular renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the renderer index.- See Also:
-
addDomainMarker
Adds a marker for a specific dataset/renderer and sends aPlotChangeEventto 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.
- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).- See Also:
-
addDomainMarker
Adds a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto 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.
- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).notify- notify listeners?
-
removeDomainMarker
Removes a marker for the domain axis and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker.- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for the domain axis in the specified layer and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeDomainMarker
Removes a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).notify- notify listeners?- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
addRangeMarker
Adds a marker for the range axis and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker- the marker (nullnot permitted).- See Also:
-
addRangeMarker
Adds a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- See Also:
-
clearRangeMarkers
public void clearRangeMarkers()Clears all the range markers and sends aPlotChangeEventto all registered listeners.- See Also:
-
addRangeMarker
Adds a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).- See Also:
-
addRangeMarker
Adds a marker for a specific dataset/renderer and, if requested, sends aPlotChangeEventto all registered listeners.Typically a marker will be drawn by the renderer as a line perpendicular to the range axis, however this is entirely up to the renderer.
- Parameters:
index- the dataset/renderer index.marker- the marker.layer- the layer (foreground or background).notify- notify listeners?
-
clearRangeMarkers
public void clearRangeMarkers(int index) Clears the (foreground and background) range markers for a particular renderer.- Parameters:
index- the renderer index.
-
removeRangeMarker
Removes a marker for the range axis and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker.- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeRangeMarker
Removes a marker for the range axis in the specified layer and sends aPlotChangeEventto all registered listeners.- Parameters:
marker- the marker (nullnot permitted).layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeRangeMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker (nullnot permitted).layer- the layer (foreground or background).- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
removeRangeMarker
Removes a marker for a specific dataset/renderer and sends aPlotChangeEventto all registered listeners.- Parameters:
index- the dataset/renderer index.marker- the marker (nullnot permitted).layer- the layer (foreground or background) (nullnot permitted).notify- notify listeners?- Returns:
- A boolean indicating whether or not the marker was actually removed.
-
addAnnotation
Adds an annotation to the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).- See Also:
-
addAnnotation
Adds an annotation to the plot and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).notify- notify listeners?
-
removeAnnotation
Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).- Returns:
- A boolean (indicates whether or not the annotation was removed).
- See Also:
-
removeAnnotation
Removes an annotation from the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
annotation- the annotation (nullnot permitted).notify- notify listeners?- Returns:
- A boolean (indicates whether or not the annotation was removed).
-
getAnnotations
Returns the list of annotations.- Returns:
- The list of annotations.
- See Also:
-
clearAnnotations
public void clearAnnotations()Clears all the annotations and sends aPlotChangeEventto all registered listeners.- See Also:
-
getShadowGenerator
Returns the shadow generator for the plot, if any.- Returns:
- The shadow generator (possibly
null).
-
setShadowGenerator
Sets the shadow generator for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).
-
calculateAxisSpace
Calculates the space required for all the axes in the plot.- Parameters:
g2- the graphics device.plotArea- the plot area.- Returns:
- The required space.
-
calculateDomainAxisSpace
Calculates the space required for the domain axis/axes.- Parameters:
g2- the graphics device.plotArea- the plot area.space- a carrier for the result (nullpermitted).- Returns:
- The required space.
-
calculateRangeAxisSpace
Calculates the space required for the range axis/axes.- Parameters:
g2- the graphics device.plotArea- the plot area.space- a carrier for the result (nullpermitted).- Returns:
- The required space.
-
draw
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info) Draws the plot within the specified area on a graphics device.- Specified by:
drawin classPlot- Parameters:
g2- the graphics device.area- the plot area (in Java2D space).anchor- an anchor point in Java2D space (nullpermitted).parentState- the state from the parent plot, if there is one (nullpermitted).info- collects chart drawing information (nullpermitted).
-
drawBackground
Draws the background for the plot.- Overrides:
drawBackgroundin classPlot- Parameters:
g2- the graphics device.area- the area.
-
drawQuadrants
Draws the quadrants.- Parameters:
g2- the graphics device.area- the area.- See Also:
-
drawDomainTickBands
Draws the domain tick bands, if any.- Parameters:
g2- the graphics device.dataArea- the data area.ticks- the ticks.- See Also:
-
drawRangeTickBands
Draws the range tick bands, if any.- Parameters:
g2- the graphics device.dataArea- the data area.ticks- the ticks.- See Also:
-
drawAxes
protected Map<Axis,AxisState> drawAxes(Graphics2D g2, Rectangle2D plotArea, Rectangle2D dataArea, PlotRenderingInfo plotState) A utility method for drawing the axes.- Parameters:
g2- the graphics device (nullnot permitted).plotArea- the plot area (nullnot permitted).dataArea- the data area (nullnot permitted).plotState- collects information about the plot (nullpermitted).- Returns:
- A map containing the state for each axis drawn.
-
render
public boolean render(Graphics2D g2, Rectangle2D dataArea, int index, PlotRenderingInfo info, CrosshairState crosshairState) Draws a representation of the data within the dataArea region, using the current renderer.The
infoandcrosshairStatearguments may benull.- Parameters:
g2- the graphics device.dataArea- the region in which the data is to be drawn.index- the dataset index.info- an optional object for collection dimension information.crosshairState- collects crosshair information (nullpermitted).- Returns:
- A flag that indicates whether any data was actually rendered.
-
getDomainAxisForDataset
Returns the domain axis for a dataset.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The axis.
-
getRangeAxisForDataset
Returns the range axis for a dataset.- Parameters:
index- the dataset index (must be >= 0).- Returns:
- The axis.
-
drawDomainGridlines
Draws the gridlines for the plot, if they are visible.- Parameters:
g2- the graphics device.dataArea- the data area.ticks- the ticks.- See Also:
-
drawRangeGridlines
Draws the gridlines for the plot's primary range axis, if they are visible.- Parameters:
g2- the graphics device.area- the data area.ticks- the ticks.- See Also:
-
drawZeroDomainBaseline
Draws a base line across the chart at value zero on the domain axis.- Parameters:
g2- the graphics device.area- the data area.- See Also:
-
drawZeroRangeBaseline
Draws a base line across the chart at value zero on the range axis.- Parameters:
g2- the graphics device.area- the data area.- See Also:
-
drawAnnotations
Draws the annotations for the plot.- Parameters:
g2- the graphics device.dataArea- the data area.info- the chart rendering info.
-
drawDomainMarkers
Draws the domain markers (if any) for an axis and layer. This method is typically called from within the draw() method.- Parameters:
g2- the graphics device.dataArea- the data area.index- the dataset/renderer index.layer- the layer (foreground or background).
-
drawRangeMarkers
Draws the range markers (if any) for a renderer 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).
-
getDomainMarkers
Returns the list of domain markers (read only) for the specified layer.- Parameters:
layer- the layer (foreground or background).- Returns:
- The list of domain markers.
- See Also:
-
getRangeMarkers
Returns the list of range markers (read only) for the specified layer.- Parameters:
layer- the layer (foreground or background).- Returns:
- The list of range markers.
- See Also:
-
getDomainMarkers
Returns a collection of domain markers for a particular renderer and layer.- Parameters:
index- the renderer index.layer- the layer.- Returns:
- A collection of markers (possibly
null). - See Also:
-
getRangeMarkers
Returns a collection of range markers for a particular renderer and layer.- Parameters:
index- the renderer index.layer- the layer.- Returns:
- A collection of markers (possibly
null). - See Also:
-
drawHorizontalLine
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.- 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.
-
drawDomainCrosshair
protected void drawDomainCrosshair(Graphics2D g2, Rectangle2D dataArea, PlotOrientation orientation, double value, ValueAxis axis, Stroke stroke, Paint paint) Draws a domain 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.
-
drawVerticalLine
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.- 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.
-
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.
-
handleClick
Handles a 'click' on the plot by updating the anchor values.- Overrides:
handleClickin classPlot- 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.
-
getDomainAxisIndex
Returns the index of the given domain axis.- Parameters:
axis- the axis.- Returns:
- The axis index.
- See Also:
-
getRangeAxisIndex
Returns the index of the given range axis.- Parameters:
axis- the axis.- Returns:
- The axis index.
- See Also:
-
getDataRange
Returns the range for the specified axis.- Specified by:
getDataRangein interfaceValueAxisPlot- Parameters:
axis- the axis.- Returns:
- The range.
-
annotationChanged
Receives notification of a change to anAnnotationadded to this plot.- Specified by:
annotationChangedin interfaceAnnotationChangeListener- Overrides:
annotationChangedin classPlot- Parameters:
event- information about the event (not used here).
-
datasetChanged
Receives notification of a change to the plot's dataset.The axis ranges are updated if necessary.
- Specified by:
datasetChangedin interfaceDatasetChangeListener- Overrides:
datasetChangedin classPlot- Parameters:
event- information about the event (not used here).
-
rendererChanged
Receives notification of a renderer change event.- Specified by:
rendererChangedin interfaceRendererChangeListener- Parameters:
event- the event.
-
isDomainCrosshairVisible
public boolean isDomainCrosshairVisible()Returns a flag indicating whether or not the domain crosshair is visible.- Returns:
- The flag.
- See Also:
-
setDomainCrosshairVisible
public void setDomainCrosshairVisible(boolean flag) Sets the flag indicating whether or not the domain crosshair is visible and, if the flag changes, sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the new value of the flag.- See Also:
-
isDomainCrosshairLockedOnData
public boolean isDomainCrosshairLockedOnData()Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values.- Returns:
- The flag.
- See Also:
-
setDomainCrosshairLockedOnData
public void setDomainCrosshairLockedOnData(boolean flag) Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values. If the flag value changes, this method sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the flag.- See Also:
-
getDomainCrosshairValue
public double getDomainCrosshairValue()Returns the domain crosshair value.- Returns:
- The value.
- See Also:
-
setDomainCrosshairValue
public void setDomainCrosshairValue(double value) Sets the domain crosshair value and sends aPlotChangeEventto all registered listeners (provided that the domain crosshair is visible).- Parameters:
value- the value.- See Also:
-
setDomainCrosshairValue
public void setDomainCrosshairValue(double value, boolean notify) Sets the domain crosshair value and, if requested, sends aPlotChangeEventto all registered listeners (provided that the domain crosshair is visible).- Parameters:
value- the new value.notify- notify listeners?- See Also:
-
getDomainCrosshairStroke
Returns theStrokeused to draw the crosshair (if visible).- Returns:
- The crosshair stroke (never
null). - See Also:
-
setDomainCrosshairStroke
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 (nullnot permitted).- See Also:
-
getDomainCrosshairPaint
Returns the domain crosshair paint.- Returns:
- The crosshair paint (never
null). - See Also:
-
setDomainCrosshairPaint
Sets the paint used to draw the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the new crosshair paint (nullnot permitted).- See Also:
-
isRangeCrosshairVisible
public boolean isRangeCrosshairVisible()Returns a flag indicating whether or not the range crosshair is visible.- Returns:
- The flag.
- See Also:
-
setRangeCrosshairVisible
public void setRangeCrosshairVisible(boolean flag) Sets the flag indicating whether or not the range crosshair is visible. If the flag value changes, this method sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the new value of the flag.- See Also:
-
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:
-
setRangeCrosshairLockedOnData
public void setRangeCrosshairLockedOnData(boolean flag) Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values. If the flag value changes, this method sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the flag.- See Also:
-
getRangeCrosshairValue
public double getRangeCrosshairValue()Returns the range crosshair value.- Returns:
- The value.
- See Also:
-
setRangeCrosshairValue
public void setRangeCrosshairValue(double value) Sets the range crosshair value.Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.
- Parameters:
value- the new value.- See Also:
-
setRangeCrosshairValue
public void setRangeCrosshairValue(double value, boolean notify) Sets the range crosshair value and sends aPlotChangeEventto all registered listeners, but only if the crosshair is visible.- Parameters:
value- the new value.notify- a flag that controls whether or not listeners are notified.- See Also:
-
getRangeCrosshairStroke
Returns the stroke used to draw the crosshair (if visible).- Returns:
- The crosshair stroke (never
null). - See Also:
-
setRangeCrosshairStroke
Sets the stroke used to draw the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the new crosshair stroke (nullnot permitted).- See Also:
-
getRangeCrosshairPaint
Returns the range crosshair paint.- Returns:
- The crosshair paint (never
null). - See Also:
-
setRangeCrosshairPaint
Sets the paint used to color the crosshairs (if visible) and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the new crosshair paint (nullnot permitted).- See Also:
-
getFixedDomainAxisSpace
Returns the fixed domain axis space.- Returns:
- The fixed domain axis space (possibly
null). - See Also:
-
setFixedDomainAxisSpace
Sets the fixed domain axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).- See Also:
-
setFixedDomainAxisSpace
Sets the fixed domain axis space and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).notify- notify listeners?- See Also:
-
getFixedRangeAxisSpace
Returns the fixed range axis space.- Returns:
- The fixed range axis space (possibly
null). - See Also:
-
setFixedRangeAxisSpace
Sets the fixed range axis space and sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).- See Also:
-
setFixedRangeAxisSpace
Sets the fixed range axis space and, if requested, sends aPlotChangeEventto all registered listeners.- Parameters:
space- the space (nullpermitted).notify- notify listeners?- See Also:
-
isDomainPannable
public boolean isDomainPannable()Returnstrueif panning is enabled for the domain axes, andfalseotherwise.- Specified by:
isDomainPannablein interfacePannable- Returns:
- A boolean.
-
setDomainPannable
public void setDomainPannable(boolean pannable) Sets the flag that enables or disables panning of the plot along the domain axes.- Parameters:
pannable- the new flag value.
-
isRangePannable
public boolean isRangePannable()Returnstrueif panning is enabled for the range axis/axes, andfalseotherwise. The default value isfalse.- Specified by:
isRangePannablein interfacePannable- Returns:
- A boolean.
-
setRangePannable
public void setRangePannable(boolean pannable) Sets the flag that enables or disables panning of the plot along the range axis/axes.- Parameters:
pannable- the new flag value.
-
panDomainAxes
Pans the domain axes by the specified percentage.- Specified by:
panDomainAxesin interfacePannable- Parameters:
percent- the distance to pan (as a percentage of the axis length).info- the plot infosource- the source point where the pan action started.
-
panRangeAxes
Pans the range axes by the specified percentage.- Specified by:
panRangeAxesin interfacePannable- Parameters:
percent- the distance to pan (as a percentage of the axis length).info- the plot infosource- the source point where the pan action started.
-
zoomDomainAxes
Multiplies the range on the domain axis/axes by the specified factor.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point (in Java2D space).- See Also:
-
zoomDomainAxes
public void zoomDomainAxes(double factor, PlotRenderingInfo info, Point2D source, boolean useAnchor) Multiplies the range on the domain axis/axes by the specified factor.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point (in Java2D space).useAnchor- use source point as zoom anchor?- See Also:
-
zoomDomainAxes
public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) Zooms in on the domain axis/axes. The new lower and upper bounds are specified as percentages of the current axis range, where 0 percent is the current lower bound and 100 percent is the current upper bound.- Specified by:
zoomDomainAxesin interfaceZoomable- Parameters:
lowerPercent- a percentage that determines the new lower bound for the axis (e.g. 0.20 is twenty percent).upperPercent- a percentage that determines the new upper bound for the axis (e.g. 0.80 is eighty percent).info- the plot rendering info.source- the source point (ignored).- See Also:
-
zoomRangeAxes
Multiplies the range on the range axis/axes by the specified factor.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point.- See Also:
-
zoomRangeAxes
Multiplies the range on the range axis/axes by the specified factor.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
factor- the zoom factor.info- the plot rendering info.source- the source point.useAnchor- a flag that controls whether or not the source point is used for the zoom anchor.- See Also:
-
zoomRangeAxes
public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo info, Point2D source) Zooms in on the range axes.- Specified by:
zoomRangeAxesin interfaceZoomable- Parameters:
lowerPercent- the lower bound.upperPercent- the upper bound.info- the plot rendering info.source- the source point.- See Also:
-
isDomainZoomable
public boolean isDomainZoomable()Returnstrue, indicating that the domain axis/axes for this plot are zoomable.- Specified by:
isDomainZoomablein interfaceZoomable- Returns:
- A boolean.
- See Also:
-
isRangeZoomable
public boolean isRangeZoomable()Returnstrue, indicating that the range axis/axes for this plot are zoomable.- Specified by:
isRangeZoomablein interfaceZoomable- Returns:
- A boolean.
- See Also:
-
getSeriesCount
public int getSeriesCount()Returns the number of series in the primary dataset for this plot. If the dataset isnull, the method returns 0.- Returns:
- The series count.
-
getFixedLegendItems
Returns the fixed legend items, if any.- Returns:
- The legend items (possibly
null). - See Also:
-
setFixedLegendItems
Sets the fixed legend items for the plot. Leave this set tonullif you prefer the legend items to be created automatically.- Parameters:
items- the legend items (nullpermitted).- See Also:
-
getLegendItems
Returns the legend items for the plot. Each legend item is generated by the plot's renderer, since the renderer is responsible for the visual representation of the data.- Specified by:
getLegendItemsin interfaceLegendItemSource- Overrides:
getLegendItemsin classPlot- Returns:
- The legend items.
-
equals
Tests this plot for equality with another object. -
clone
Returns a clone of the plot.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classPlot- Returns:
- A clone.
- Throws:
CloneNotSupportedException- this can occur if some component of the plot cannot be cloned.
-
dispose
public void dispose()- Specified by:
disposein interfaceDisposable
-