|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.plot.Plot
org.jfree.chart.plot.SpiderWebPlot
A plot that displays data from a CategoryDataset
in the form of a
"spider web". Multiple series can be plotted on the same axis to allow
easy comparison.
Field Summary | |
static double |
DEFAULT_AXIS_LABEL_GAP
The default axis label gap (currently 10%). |
static double |
DEFAULT_HEAD
The default head radius percent (currently 1%). |
static double |
DEFAULT_INTERIOR_GAP
The default interior gap. |
static java.awt.Paint |
DEFAULT_LABEL_BACKGROUND_PAINT
The default series label background paint. |
static java.awt.Font |
DEFAULT_LABEL_FONT
The default series label font. |
static java.awt.Paint |
DEFAULT_LABEL_OUTLINE_PAINT
The default series label outline paint. |
static java.awt.Stroke |
DEFAULT_LABEL_OUTLINE_STROKE
The default series label outline stroke. |
static java.awt.Paint |
DEFAULT_LABEL_PAINT
The default series label paint. |
static java.awt.Paint |
DEFAULT_LABEL_SHADOW_PAINT
The default series label shadow paint. |
static double |
DEFAULT_MAX_VALUE
The default maximum value plotted - forces the plot to evaluate the maximum from the data passed in |
static double |
DEFAULT_START_ANGLE
The default starting angle for the radar chart axes. |
protected double |
headPercent
The head radius as a percentage of the available drawing area. |
static double |
MAX_INTERIOR_GAP
The maximum interior gap (currently 40%). |
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 | |
SpiderWebPlot(CategoryDataset dataset)
Creates a new radar plot with default attributes. |
|
SpiderWebPlot(CategoryDataset data,
TableOrder type)
Creates a new radar plot overriding the data extraction order. |
Method Summary | |
protected java.awt.geom.Point2D |
calculateLabelLocation(java.awt.geom.Rectangle2D labelBounds,
double ascent,
java.awt.geom.Rectangle2D plotArea,
double startAngle)
Returns the location for a label |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
PlotState parentState,
PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
protected void |
drawLabel(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
double value,
int cat,
double startAngle,
double extent)
Draws the label for one axis. |
protected void |
drawRadarPoly(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
java.awt.geom.Point2D centre,
PlotRenderingInfo info,
int series,
int catCount,
double headH,
double headW)
Draws a radar plot polygon. |
java.awt.Paint |
getBaseSeriesOutlinePaint()
Returns the base series paint. |
java.awt.Stroke |
getBaseSeriesOutlineStroke()
Returns the base series stroke. |
java.awt.Paint |
getBaseSeriesPaint()
Returns the base series paint. |
TableOrder |
getDataExtractOrder()
Returns the data extract order (by row or by column). |
Rotation |
getDirection()
Returns the direction in which the radar axes are drawn (clockwise or anti-clockwise). |
double |
getInteriorGap()
Returns the interior gap, measured as a percentage of the available drawing space. |
java.awt.Font |
getLabelFont()
Returns the series label font. |
CategoryLabelGenerator |
getLabelGenerator()
Returns the label generator. |
java.awt.Paint |
getLabelPaint()
Returns the series label paint. |
LegendItemCollection |
getLegendItems()
Returns a collection of legend items for the radar chart. |
java.awt.Shape |
getLegendItemShape()
Returns the shape used for legend items. |
double |
getMaxValue()
Returns the maximum value any category axis can take. |
java.lang.String |
getPlotType()
Returns a short string describing the type of plot. |
java.awt.Paint |
getSeriesOutlinePaint()
Returns the outline paint for ALL series in the plot. |
java.awt.Paint |
getSeriesOutlinePaint(int series)
Returns the paint for the specified series. |
java.awt.Stroke |
getSeriesOutlineStroke()
Returns the outline stroke for ALL series in the plot. |
java.awt.Stroke |
getSeriesOutlineStroke(int series)
Returns the stroke for the specified series. |
java.awt.Paint |
getSeriesPaint()
Returns the paint for ALL series in the plot. |
java.awt.Paint |
getSeriesPaint(int series)
Returns the paint for the specified series. |
double |
getStartAngle()
Returns the start angle for the first radar axis. |
protected java.awt.geom.Point2D |
getWebPoint(java.awt.geom.Rectangle2D bounds,
double angle,
double length)
Returns a cartesian point from a polar angle, length and bounding box |
boolean |
isWebFilled()
Method to determine if the web chart is to be filled. |
void |
setBaseSeriesOutlinePaint(java.awt.Paint paint)
Sets the base series paint. |
void |
setBaseSeriesOutlineStroke(java.awt.Stroke stroke)
Sets the base series stroke. |
void |
setBaseSeriesPaint(java.awt.Paint paint)
Sets the base series paint. |
void |
setDataExtractOrder(TableOrder order)
Sets the data extract order (by row or by column) and sends a PlotChangeEvent to all registered listeners. |
void |
setDirection(Rotation direction)
Sets the direction in which the radar axes are drawn and sends a PlotChangeEvent to all registered listeners. |
void |
setInteriorGap(double percent)
Sets the interior gap and sends a PlotChangeEvent to all
registered listeners. |
void |
setLabelFont(java.awt.Font font)
Sets the series label font and sends a PlotChangeEvent to all
registered listeners. |
void |
setLabelGenerator(CategoryLabelGenerator generator)
Sets the label generator and sends a PlotChangeEvent to all
registered listeners. |
void |
setLabelPaint(java.awt.Paint paint)
Sets the series label paint and sends a PlotChangeEvent to all
registered listeners. |
void |
setLegendItemShape(java.awt.Shape shape)
Sets the shape used for legend items. |
void |
setMaxValue(double value)
Sets the maximum value any category axis can take and sends a PlotChangeEvent to all registered listeners. |
void |
setSeriesOutlinePaint(int series,
java.awt.Paint paint)
Sets the paint used to fill a series of the radar and sends a PlotChangeEvent to all registered listeners. |
void |
setSeriesOutlinePaint(java.awt.Paint paint)
Sets the outline paint for ALL series in the plot. |
void |
setSeriesOutlineStroke(int series,
java.awt.Stroke stroke)
Sets the stroke used to fill a series of the radar and sends a PlotChangeEvent to all registered listeners. |
void |
setSeriesOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke for ALL series in the plot. |
void |
setSeriesPaint(int series,
java.awt.Paint paint)
Sets the paint used to fill a series of the radar and sends a PlotChangeEvent to all registered listeners. |
void |
setSeriesPaint(java.awt.Paint paint)
Sets the paint for ALL series in the plot. |
void |
setStartAngle(double angle)
Sets the starting angle and sends a PlotChangeEvent to all
registered listeners. |
void |
setWebFilled(boolean flag)
Sets the webFilled flag and sends a PlotChangeEvent to all registered listeners. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double DEFAULT_HEAD
public static final double DEFAULT_AXIS_LABEL_GAP
public static final double DEFAULT_INTERIOR_GAP
public static final double MAX_INTERIOR_GAP
public static final double DEFAULT_START_ANGLE
public static final java.awt.Font DEFAULT_LABEL_FONT
public static final java.awt.Paint DEFAULT_LABEL_PAINT
public static final java.awt.Paint DEFAULT_LABEL_BACKGROUND_PAINT
public static final java.awt.Paint DEFAULT_LABEL_OUTLINE_PAINT
public static final java.awt.Stroke DEFAULT_LABEL_OUTLINE_STROKE
public static final java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
public static final double DEFAULT_MAX_VALUE
protected double headPercent
Constructor Detail |
public SpiderWebPlot(CategoryDataset dataset)
dataset
- the dataset.public SpiderWebPlot(CategoryDataset data, TableOrder type)
data
- the data.type
- controls how radar data is extracted (BY_ROW or BY_COLUMN).Method Detail |
public java.lang.String getPlotType()
getPlotType
in class Plot
public boolean isWebFilled()
public void setWebFilled(boolean flag)
PlotChangeEvent
to all registered listeners.
flag
- the flag.public TableOrder getDataExtractOrder()
null
).public void setDataExtractOrder(TableOrder order)
PlotChangeEvent
to all registered listeners.
order
- the order (null
not permitted).public double getStartAngle()
public void setStartAngle(double angle)
PlotChangeEvent
to all
registered listeners.
The initial default value is 90 degrees, which corresponds to 12 o'clock. A value of zero corresponds to 3 o'clock... this is the encoding used by Java's Arc2D class.
angle
- the angle (in degrees).public double getMaxValue()
public void setMaxValue(double value)
PlotChangeEvent
to all registered listeners.
value
- the maximum value.public Rotation getDirection()
null
).public void setDirection(Rotation direction)
PlotChangeEvent
to all registered listeners.
direction
- the direction (null
not permitted).public double getInteriorGap()
public void setInteriorGap(double percent)
PlotChangeEvent
to all
registered listeners. This controls the space between the edges of the
plot and the plot area itself (the region where the axis labels appear).
percent
- the gap (as a percentage of the available drawing space).public java.awt.Paint getSeriesPaint()
null
).public void setSeriesPaint(java.awt.Paint paint)
paint
- the paint (null
permitted).public java.awt.Paint getSeriesPaint(int series)
series
- the series index (zero-based).
null
).public void setSeriesPaint(int series, java.awt.Paint paint)
PlotChangeEvent
to all registered listeners.
series
- the series index (zero-based).paint
- the paint (null
permitted).public java.awt.Paint getBaseSeriesPaint()
null
).public void setBaseSeriesPaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Paint getSeriesOutlinePaint()
null
).public void setSeriesOutlinePaint(java.awt.Paint paint)
paint
- the paint (null
permitted).public java.awt.Paint getSeriesOutlinePaint(int series)
series
- the series index (zero-based).
null
).public void setSeriesOutlinePaint(int series, java.awt.Paint paint)
PlotChangeEvent
to all registered listeners.
series
- the series index (zero-based).paint
- the paint (null
permitted).public java.awt.Paint getBaseSeriesOutlinePaint()
null
).public void setBaseSeriesOutlinePaint(java.awt.Paint paint)
paint
- the paint (null
not permitted).public java.awt.Stroke getSeriesOutlineStroke()
null
).public void setSeriesOutlineStroke(java.awt.Stroke stroke)
stroke
- the stroke (null
permitted).public java.awt.Stroke getSeriesOutlineStroke(int series)
series
- the series index (zero-based).
null
).public void setSeriesOutlineStroke(int series, java.awt.Stroke stroke)
PlotChangeEvent
to all registered listeners.
series
- the series index (zero-based).stroke
- the stroke (null
permitted).public java.awt.Stroke getBaseSeriesOutlineStroke()
null
).public void setBaseSeriesOutlineStroke(java.awt.Stroke stroke)
stroke
- the stroke (null
not permitted).public java.awt.Shape getLegendItemShape()
public void setLegendItemShape(java.awt.Shape shape)
shape
- the shape (null
not permitted).public java.awt.Font getLabelFont()
null
).public void setLabelFont(java.awt.Font font)
PlotChangeEvent
to all
registered listeners.
font
- the font (null
not permitted).public java.awt.Paint getLabelPaint()
null
).public void setLabelPaint(java.awt.Paint paint)
PlotChangeEvent
to all
registered listeners.
paint
- the paint (null
not permitted).public CategoryLabelGenerator getLabelGenerator()
null
).public void setLabelGenerator(CategoryLabelGenerator generator)
PlotChangeEvent
to all
registered listeners.
generator
- the generator (null
not permitted).public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
getLegendItems
in class Plot
protected java.awt.geom.Point2D getWebPoint(java.awt.geom.Rectangle2D bounds, double angle, double length)
bounds
- the area inside which the point needs to be.angle
- the polar angle, in degrees.length
- the relative length. Given in percent of maximum extend.
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo info)
draw
in class Plot
g2
- the graphics device.plotArea
- the area within which the plot should be drawn.parentState
- the state from the parent plot, if there is one.info
- collects info about the drawing.protected void drawRadarPoly(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, java.awt.geom.Point2D centre, PlotRenderingInfo info, int series, int catCount, double headH, double headW)
g2
- the graphics device.plotArea
- the area we are plotting in (already adjusted).centre
- the centre point of the radar axesinfo
- chart rendering info.series
- the series within the dataset we are plottingcatCount
- the number of categories per radar plotheadH
- the data point heightheadW
- the data point widthprotected void drawLabel(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, double value, int cat, double startAngle, double extent)
g2
- the graphics device.plotArea
- the plot areavalue
- the value of the label.cat
- the category (zero-based index).startAngle
- the starting angle.extent
- the extent of the arc.protected java.awt.geom.Point2D calculateLabelLocation(java.awt.geom.Rectangle2D labelBounds, double ascent, java.awt.geom.Rectangle2D plotArea, double startAngle)
labelBounds
- the label bounds.ascent
- the ascent (height of font).plotArea
- the plot areastartAngle
- the start angle for the pie series.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |