|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.xy.AbstractXYItemRenderer
org.jfree.chart.renderer.xy.XYAreaRenderer
org.jfree.chart.renderer.xy.StackedXYAreaRenderer
public class StackedXYAreaRenderer
A stacked area renderer for the XYPlot class.
SPECIAL NOTE: This renderer does not currently handle negative data values
correctly. This should get fixed at some point, but the current workaround
is to use the StackedXYAreaRenderer2 class instead.
| Field Summary |
|---|
| Fields inherited from class org.jfree.chart.renderer.xy.XYAreaRenderer |
|---|
AREA, AREA_AND_SHAPES, LINES, SHAPES, SHAPES_AND_LINES |
| Fields inherited from class org.jfree.chart.renderer.AbstractRenderer |
|---|
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO |
| Constructor Summary | |
|---|---|
StackedXYAreaRenderer()
Creates a new renderer. |
|
StackedXYAreaRenderer(int type)
Constructs a new renderer. |
|
StackedXYAreaRenderer(int type,
XYToolTipGenerator labelGenerator,
XYURLGenerator urlGenerator)
Constructs a new renderer. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of the renderer. |
void |
drawItem(java.awt.Graphics2D g2,
XYItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
Draws the visual representation of a single data item. |
boolean |
equals(java.lang.Object obj)
Tests the renderer for equality with an arbitrary object. |
Range |
findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset. |
int |
getPassCount()
Returns the number of passes required by the renderer. |
protected double |
getPreviousHeight(TableXYDataset dataset,
int series,
int index)
Calculates the stacked value of the all series up to, but not including series for the specified item. |
java.awt.Paint |
getShapePaint()
Returns the paint used for rendering shapes, or null if
using series paints. |
java.awt.Stroke |
getShapeStroke()
Returns the stroke used for rendering shapes, or null if
using series strokes. |
XYItemRendererState |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
PlotRenderingInfo info)
Initialises the renderer. |
void |
setShapePaint(java.awt.Paint shapePaint)
Sets the paint for rendering shapes and sends a RendererChangeEvent to all registered listeners. |
void |
setShapeStroke(java.awt.Stroke shapeStroke)
Sets the stroke for rendering shapes and sends a RendererChangeEvent to all registered listeners. |
| Methods inherited from class org.jfree.chart.renderer.xy.XYAreaRenderer |
|---|
getLegendArea, getLegendItem, getPlotArea, getPlotLines, getPlotShapes, isOutline, setLegendArea, setOutline |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.jfree.chart.LegendItemSource |
|---|
getLegendItems |
| Constructor Detail |
|---|
public StackedXYAreaRenderer()
public StackedXYAreaRenderer(int type)
type - the type of the renderer.
public StackedXYAreaRenderer(int type,
XYToolTipGenerator labelGenerator,
XYURLGenerator urlGenerator)
SHAPES, LINES,
SHAPES_AND_LINES, AREA or
AREA_AND_SHAPES.
type - the type of renderer.labelGenerator - the tool tip generator to use (null
is none).urlGenerator - the URL generator (null permitted).| Method Detail |
|---|
public java.awt.Paint getShapePaint()
null if
using series paints.
null).setShapePaint(Paint)public void setShapePaint(java.awt.Paint shapePaint)
RendererChangeEvent to all registered listeners.
shapePaint - the paint (null permitted).getShapePaint()public java.awt.Stroke getShapeStroke()
null if
using series strokes.
null).setShapeStroke(Stroke)public void setShapeStroke(java.awt.Stroke shapeStroke)
RendererChangeEvent to all registered listeners.
shapeStroke - the stroke (null permitted).getShapeStroke()
public XYItemRendererState initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
XYPlot plot,
XYDataset data,
PlotRenderingInfo info)
initialise in interface XYItemRendererinitialise in class XYAreaRendererg2 - the graphics device.dataArea - the area inside the axes.plot - the plot.data - the data.info - an optional info collection object to return data back to
the caller.
public int getPassCount()
getPassCount in interface XYItemRenderergetPassCount in class AbstractXYItemRendererpublic Range findRangeBounds(XYDataset dataset)
findRangeBounds in interface XYItemRendererfindRangeBounds in class AbstractXYItemRendererdataset - the dataset (null permitted).
null if the dataset is null).
java.lang.ClassCastException - if dataset is not an instance
of TableXYDataset.
public void drawItem(java.awt.Graphics2D g2,
XYItemRendererState state,
java.awt.geom.Rectangle2D dataArea,
PlotRenderingInfo info,
XYPlot plot,
ValueAxis domainAxis,
ValueAxis rangeAxis,
XYDataset dataset,
int series,
int item,
CrosshairState crosshairState,
int pass)
drawItem in interface XYItemRendererdrawItem in class XYAreaRendererg2 - the graphics device.state - the renderer state.dataArea - the area within which the data is being drawn.info - collects information about the drawing.plot - the plot (can be used to obtain standard color information
etc).domainAxis - the domain axis.rangeAxis - the range axis.dataset - the dataset.series - the series index (zero-based).item - the item index (zero-based).crosshairState - information about crosshairs on a plot.pass - the pass index.
java.lang.ClassCastException - if state is not an instance of
StackedXYAreaRendererState or dataset
is not an instance of TableXYDataset.
protected double getPreviousHeight(TableXYDataset dataset,
int series,
int index)
series for the specified item. It returns 0.0 if
series is the first series, i.e. 0.
dataset - the dataset.series - the series.index - the index.
series for index.public boolean equals(java.lang.Object obj)
equals in class XYAreaRendererobj - the object (null permitted).
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface org.jfree.util.PublicCloneableclone in class XYAreaRendererjava.lang.CloneNotSupportedException - if the renderer cannot be cloned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||