add
public void add(XYPlot subplot)
Adds a subplot, with a default 'weight' of 1.
You must ensure that the subplot has a non-null domain axis. The range
axis for the subplot will be set to null
.
add
public void add(XYPlot subplot,
int weight)
Adds a subplot with a particular weight (greater than or equal to one).
The weight determines how much space is allocated to the subplot
relative to all the other subplots.
You must ensure that the subplot has a non-null domain axis. The range
axis for the subplot will be set to null
.
subplot
- the subplot.weight
- the weight (must be 1 or greater).
calculateAxisSpace
protected AxisSpace calculateAxisSpace(Graphics2D g2,
Rectangle2D plotArea)
Calculates the space required for the axes.
- calculateAxisSpace in interface XYPlot
g2
- the graphics device.plotArea
- the plot area.
- The space required for the axes.
clone
public Object clone()
throws CloneNotSupportedException
Returns a clone of the plot.
- clone in interface XYPlot
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.
- draw in interface XYPlot
g2
- the graphics device.area
- the plot area (in Java2D space).anchor
- an anchor point in Java2D space (null
permitted).parentState
- the state from the parent plot, if there is one
(null
permitted).info
- collects chart drawing information (null
permitted).
equals
public boolean equals(Object obj)
Tests this plot for equality with another object.
- equals in interface XYPlot
findSubplot
public XYPlot findSubplot(PlotRenderingInfo info,
Point2D source)
Returns the subplot (if any) that contains the (x, y) point (specified
in Java2D space).
info
- the chart rendering info (null
not permitted).source
- the source point (null
not permitted).
- A subplot (possibly
null
).
getGap
public double getGap()
Returns the space between subplots.
getSubplots
public List getSubplots()
Returns a list of the subplots.
handleClick
public void handleClick(int x,
int y,
PlotRenderingInfo info)
Handles a 'click' on the plot by updating the anchor values...
- handleClick in interface XYPlot
x
- x-coordinate, where the click occured.y
- y-coordinate, where the click occured.info
- object containing information about the plot dimensions.
remove
public void remove(XYPlot subplot)
Removes a subplot from the combined chart.
subplot
- the subplot (null
not permitted).
setGap
public void setGap(double gap)
Sets the amount of space between subplots.
gap
- the gap between subplots
setRenderer
public void setRenderer(XYItemRenderer renderer)
Sets the item renderer FOR ALL SUBPLOTS. Registered listeners are
notified that the plot has been modified.
Note: usually you will want to set the renderer independently for each
subplot, which is NOT what this method does.
- setRenderer in interface XYPlot
renderer
- the new renderer.
zoomDomainAxes
public void zoomDomainAxes(double lowerPercent,
double upperPercent,
PlotRenderingInfo info,
Point2D source)
Zooms in on the domain axes.
- zoomDomainAxes in interface Zoomable
- zoomDomainAxes in interface XYPlot
lowerPercent
- the lower bound.upperPercent
- the upper bound.info
- the plot rendering info (null
not permitted).source
- the source point (null
not permitted).