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.
.,//,.
| Field Summary | |
|---|---|
| static Paint |
The default crosshair paint. |
| static Stroke |
The default crosshair stroke. |
| static boolean |
The default crosshair visibility. |
| static Paint |
The default grid line paint. |
| static Stroke |
The default grid line stroke. |
| protected static ResourceBundle |
The resourceBundle for the localization. |
| Fields inherited from org.jfree.chart.plotPlot |
|---|
| Constructor Summary |
|---|
|
Default constructor. |
|
Creates a new plot. |
| Method Summary | |
|---|---|
| void |
Adds an annotation to the plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for the domain axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for a renderer and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for the range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for the range axis in the specified layer and sends a PlotChangeEvent to all registered listeners. |
| void |
Adds a marker for a renderer and sends a PlotChangeEvent to all registered listeners. |
| protected AxisSpace |
Calculates the space required for all the axes in the plot. |
| protected AxisSpace |
Calculates the space required for the domain axis/axes. |
| protected AxisSpace |
Calculates the space required for the range axis/axes. |
| void |
Clears all the annotations and sends a PlotChangeEvent to all registered listeners. |
| void |
Clears the domain axes from the plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Clears all the (foreground and background) domain markers and sends a PlotChangeEvent to all registered listeners. |
| void |
Clears the (foreground and background) domain markers for a particular renderer. |
| void |
Clears the range axes from the plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Clears all the range markers and sends a PlotChangeEvent to all registered listeners. |
| void |
Clears the (foreground and background) range markers for a particular renderer. |
| Object |
Returns a clone of the plot. |
| void |
Configures the domain axes. |
| void |
Configures the range axes. |
| void |
Receives notification of a change to the plot's dataset. |
| void |
Draws the plot within the specified area on a graphics device. |
| void |
Draws the annotations for the plot. |
| protected Map |
A utility method for drawing the axes. |
| void |
Draws the background for the plot. |
| protected void |
Draws the gridlines for the plot, if they are visible. |
| protected void |
Draws the domain markers (if any) for an axis and layer. |
| void |
Draws the domain tick bands, if any. |
| protected void |
Utility method for drawing a horizontal line across the data area of the plot. |
| protected void |
Draws the quadrants. |
| protected void |
Draws the gridlines for the plot's primary range axis, if they are visible. |
| protected void |
Draws the range markers (if any) for a renderer and layer. |
| void |
Draws the range tick bands, if any. |
| protected void |
Utility method for drawing a vertical line on the data area of the plot. |
| protected void |
Draws a base line across the chart at value zero on the range axis. |
| boolean |
Tests this plot for equality with another object. |
| List |
Returns the list of annotations. |
| RectangleInsets |
Returns the axis offset. |
| Range |
Returns the range for the specified axis. |
| XYDataset |
Returns the primary dataset for the plot. |
| XYDataset |
Returns a dataset. |
| int |
Returns the number of datasets. |
| DatasetRenderingOrder |
Returns the dataset rendering order. |
| ValueAxis |
Returns the domain axis for the plot. |
| ValueAxis |
Returns a domain axis. |
| int |
Returns the number of domain axes. |
| RectangleEdge |
Returns the edge for the primary domain axis (taking into account the plot's orientation. |
| RectangleEdge |
Returns the edge for a domain axis. |
| ValueAxis |
Returns the domain axis for a dataset. |
| protected int |
Returns the index of the given domain axis. |
| AxisLocation |
Returns the location of the primary domain axis. |
| AxisLocation |
Returns the location for a domain axis. |
| Paint |
Returns the domain crosshair color. |
| Stroke |
Returns the Stroke used to draw the crosshair (if visible). |
| double |
Returns the domain crosshair value. |
| Paint |
Returns the paint for the grid lines (if any) plotted against the domain axis. |
| Stroke |
Returns the stroke for the grid-lines (if any) plotted against the domain axis. |
| Collection |
Returns the list of domain markers (read only) for the specified layer. |
| Collection |
Returns a collection of domain markers for a particular renderer and layer. |
| Paint |
Returns the paint used for the domain tick bands. |
| AxisSpace |
Returns the fixed domain axis space. |
| LegendItemCollection |
Returns the fixed legend items, if any. |
| AxisSpace |
Returns the fixed range axis space. |
| int |
Returns the index of the specified renderer, or -1 if the
renderer is not assigned to this plot.
|
| LegendItemCollection |
Returns the legend items for the plot. |
| PlotOrientation |
Returns the orientation of the plot. |
| String |
Returns the plot type as a string. |
| Point2D |
Returns the origin for the quadrants that can be displayed on the plot. |
| Paint |
Returns the paint used for the specified quadrant. |
| ValueAxis |
Returns the range axis for the plot. |
| ValueAxis |
Returns a range axis. |
| int |
Returns the number of range axes. |
| RectangleEdge |
Returns the edge for the primary range axis. |
| RectangleEdge |
Returns the edge for a range axis. |
| ValueAxis |
Returns the range axis for a dataset. |
| protected int |
Returns the index of the given range axis. |
| AxisLocation |
Returns the location of the primary range axis. |
| AxisLocation |
Returns the location for a range axis. |
| Paint |
Returns the range crosshair color. |
| Stroke |
Returns the Stroke used to draw the crosshair (if visible). |
| double |
Returns the range crosshair value. |
| Paint |
Returns the paint for the grid lines (if any) plotted against the range axis. |
| Stroke |
Returns the stroke for the grid lines (if any) plotted against the range axis. |
| Collection |
Returns the list of range markers (read only) for the specified layer. |
| Collection |
Returns a collection of range markers for a particular renderer and layer. |
| Paint |
Returns the paint used for the range tick bands. |
| Paint |
Returns the paint for the zero baseline (if any) plotted against the range axis. |
| Stroke |
Returns the stroke used for the zero baseline against the range axis. |
| XYItemRenderer |
Returns the renderer for the primary dataset. |
| XYItemRenderer |
Returns the renderer for a dataset, or null.
|
| XYItemRenderer |
Returns the renderer for the specified dataset. |
| int |
Returns the number of series in the primary dataset for this plot. |
| SeriesRenderingOrder |
Returns the series rendering order. |
| int |
Returns the weight for this plot when it is used as a subplot within a combined plot. |
| void |
Handles a 'click' on the plot by updating the anchor values... |
| int |
Returns the index of the specified dataset, or -1 if the
dataset does not belong to the plot.
|
| boolean |
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values. |
| boolean |
Returns a flag indicating whether or not the domain crosshair is visible. |
| boolean |
Returns true if the domain gridlines are visible, and
false
|
| boolean |
Returns true
|
| boolean |
Returns a flag indicating whether or not the crosshair should "lock-on" to actual data values. |
| boolean |
Returns a flag indicating whether or not the range crosshair is visible. |
| boolean |
Returns true if the range axis grid is visible, and
false
|
| boolean |
Returns a flag that controls whether or not a zero baseline is displayed for the range axis. |
| boolean |
Returns true
|
| void |
Maps a dataset to a particular domain axis. |
| void |
Maps a dataset to a particular range axis. |
| boolean |
Removes an annotation from the plot and sends a PlotChangeEvent to all registered listeners. |
| boolean |
Draws a representation of the data within the dataArea region, using the current renderer. |
| void |
Receives notification of a renderer change event. |
| void |
Sets the axis offsets (gap between the data area and the axes). |
| void |
Sets the primary dataset for the plot, replacing the existing dataset if there is one. |
| void |
Sets a dataset for the plot. |
| void |
Sets the rendering order and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a domain axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a domain axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location of the domain axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values. |
| void |
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
| void |
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
| void |
Sets the domain crosshair value and sends a PlotChangeEvent to all registered listeners (provided that the domain crosshair is visible). |
| void |
Sets the domain crosshair value and, if requested, sends a PlotChangeEvent to all registered listeners (provided that the domain crosshair is visible). |
| void |
Sets the flag indicating whether or not the domain crosshair is visible. |
| void |
Sets the paint for the grid lines plotted against the domain axis. |
| void |
Sets the stroke for the grid lines plotted against the domain axis. |
| void |
Sets the flag that controls whether or not the domain grid-lines are visible. |
| void |
Sets the paint for the domain tick bands. |
| void |
Sets the fixed domain axis space. |
| void |
Sets the fixed legend items for the plot. |
| void |
Sets the fixed range axis space. |
| void |
Sets the orientation for the plot. |
| void |
Sets the quadrant origin and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the paint used for the specified quadrant and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the range axes for this plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a range axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location of the primary range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location of the primary range axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the location for a range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the flag indicating whether or not the range crosshair should "lock-on" to actual data values. |
| void |
Sets the Paint used to color the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
| void |
Sets the Stroke used to draw the crosshairs (if visible) and notifies registered listeners that the axis has been modified. |
| void |
Sets the domain crosshair value. |
| void |
Sets the range crosshair value. |
| void |
Sets the flag indicating whether or not the range crosshair is visible. |
| void |
Sets the paint for the grid lines plotted against the range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the stroke for the grid lines plotted against the range axis, and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the flag that controls whether or not the range axis grid lines are visible. |
| void |
Sets the paint for the range tick bands. |
| void |
Sets the paint for the zero baseline plotted against the range axis and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the stroke for the zero baseline for the range axis, and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the flag that controls whether or not the zero baseline is displayed for the range axis, and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the renderer for the primary dataset and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a renderer and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets a renderer and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the renderers for this plot and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the series order and sends a PlotChangeEvent to all registered listeners. |
| void |
Sets the weight for the plot. |
| void |
Multiplies the range on the domain axis/axes by the specified factor. |
| void |
Zooms in on the domain axis/axes. |
| void |
Multiplies the range on the range axis/axes by the specified factor. |
| void |
Zooms in on the range axes. |
| Methods inherited from org.jfree.chart.eventAxisChangeListener |
|---|
| Methods inherited from java.langObject |
|---|
public XYPlot
(
XYDataset
dataset,
ValueAxis
domainAxis,
ValueAxis
rangeAxis,
XYItemRenderer
renderer
)
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.
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.
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.
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.
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.
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
calculateDomainAxisSpace
(
Graphics2D
g2,
Rectangle2D
plotArea,
AxisSpace
space
)
protected
AxisSpace
calculateRangeAxisSpace
(
Graphics2D
g2,
Rectangle2D
plotArea,
AxisSpace
space
)
public
void
clearAnnotations
(
)
public
void
clearDomainAxes
(
)
public
void
clearDomainMarkers
(
)
public
void
clearDomainMarkers
(
int
index
)
public
void
clearRangeAxes
(
)
public
void
clearRangeMarkers
(
)
public
void
clearRangeMarkers
(
int
index
)
The axis ranges are updated if necessary.
public
void
draw
(
Graphics2D
g2,
Rectangle2D
area,
Point2D
anchor,
PlotState
parentState,
PlotRenderingInfo
info
)
protected
Map
drawAxes
(
Graphics2D
g2,
Rectangle2D
plotArea,
Rectangle2D
dataArea,
PlotRenderingInfo
plotState
)
protected
void
drawHorizontalLine
(
Graphics2D
g2,
Rectangle2D
dataArea,
double
value,
Stroke
stroke,
Paint
paint
)
protected
void
drawVerticalLine
(
Graphics2D
g2,
Rectangle2D
dataArea,
double
value,
Stroke
stroke,
Paint
paint
)
null, no tick bands will be drawn. -1 if the
renderer is not assigned to this plot. null, no tick bands will be drawn. null.
public
int
getSeriesCount
(
)
null, the method returns 0.
public
int
getWeight
(
)
-1 if the
dataset does not belong to the plot.
public
boolean
isDomainCrosshairLockedOnData
(
)
public
boolean
isDomainCrosshairVisible
(
)
public
boolean
isDomainGridlinesVisible
(
)
true if the domain gridlines are visible, and
false otherwise.
public
boolean
isDomainZoomable
(
)
true
public
boolean
isRangeCrosshairLockedOnData
(
)
public
boolean
isRangeCrosshairVisible
(
)
public
boolean
isRangeGridlinesVisible
(
)
true if the range axis grid is visible, and
false otherwise.
public
boolean
isRangeZeroBaselineVisible
(
)
public
boolean
isRangeZoomable
(
)
true
public
void
mapDatasetToDomainAxis
(
int
index,
int
axisIndex
)
public
void
mapDatasetToRangeAxis
(
int
index,
int
axisIndex
)
public
boolean
render
(
Graphics2D
g2,
Rectangle2D
dataArea,
int
index,
PlotRenderingInfo
info,
CrosshairState
crosshairState
)
The info and crosshairState arguments may be
null.
public
void
setDomainCrosshairLockedOnData
(
boolean
flag
)
public
void
setDomainCrosshairValue
(
double
value
)
public
void
setDomainCrosshairValue
(
double
value,
boolean
notify
)
public
void
setDomainCrosshairVisible
(
boolean
flag
)
If you set this to null, no grid lines will be drawn.
If you set this to null, no grid lines will be drawn.
public
void
setDomainGridlinesVisible
(
boolean
visible
)
If the flag value is changed, a PlotChangeEvent is sent to all registered listeners.
null if you prefer the legend items to be created
automatically.
public
void
setRangeCrosshairLockedOnData
(
boolean
flag
)
public
void
setRangeCrosshairValue
(
double
value
)
Registered listeners are notified that the plot has been modified, but only if the crosshair is visible.
public
void
setRangeCrosshairValue
(
double
value,
boolean
notify
)
Registered listeners are notified that the axis has been modified, but only if the crosshair is visible.
public
void
setRangeCrosshairVisible
(
boolean
flag
)
public
void
setRangeGridlinesVisible
(
boolean
visible
)
If the flag value is changed, a PlotChangeEvent is sent to all registered listeners.
public
void
setRangeZeroBaselineVisible
(
boolean
visible
)
null, no data will be displayed.
public
void
zoomDomainAxes
(
double
lowerPercent,
double
upperPercent,
PlotRenderingInfo
info,
Point2D
source
)
public
void
zoomRangeAxes
(
double
lowerPercent,
double
upperPercent,
PlotRenderingInfo
info,
Point2D
source
)