Package org.jfree.chart.plot
Class SpiderWebPlot
- java.lang.Object
-
- org.jfree.chart.plot.Plot
-
- org.jfree.chart.plot.SpiderWebPlot
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.EventListener,AnnotationChangeListener,AxisChangeListener,MarkerChangeListener,LegendItemSource,PublicCloneable,DatasetChangeListener
public class SpiderWebPlot extends Plot implements java.lang.Cloneable, java.io.Serializable
A plot that displays data from aCategoryDatasetin the form of a "spider web". Multiple series can be plotted on the same axis to allow easy comparison. This plot doesn't support negative values at present.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private doubleaxisLabelGapThe gap between the labels and the axes as a %age of the radius.private java.awt.PaintaxisLinePaintThe paint used to draw the axis lines.private java.awt.StrokeaxisLineStrokeThe stroke used to draw the axis lines.private java.awt.PaintbaseSeriesOutlinePaintThe base series outline paint (fallback).private java.awt.StrokebaseSeriesOutlineStrokeThe base series outline stroke (fallback).private java.awt.PaintbaseSeriesPaintThe base series paint (fallback).private TableOrderdataExtractOrderThe data extract order (BY_ROW or BY_COLUMN).private CategoryDatasetdatasetThe dataset.static doubleDEFAULT_AXIS_LABEL_GAPThe default axis label gap (currently 10%).static doubleDEFAULT_HEADThe default head radius percent (currently 1%).static doubleDEFAULT_INTERIOR_GAPThe default interior gap.static java.awt.PaintDEFAULT_LABEL_BACKGROUND_PAINTThe default series label background paint.static java.awt.FontDEFAULT_LABEL_FONTThe default series label font.static java.awt.PaintDEFAULT_LABEL_OUTLINE_PAINTThe default series label outline paint.static java.awt.StrokeDEFAULT_LABEL_OUTLINE_STROKEThe default series label outline stroke.static java.awt.PaintDEFAULT_LABEL_PAINTThe default series label paint.static java.awt.PaintDEFAULT_LABEL_SHADOW_PAINTThe default series label shadow paint.static doubleDEFAULT_MAX_VALUEThe default maximum value plotted - forces the plot to evaluate the maximum from the data passed instatic doubleDEFAULT_START_ANGLEThe default starting angle for the radar chart axes.private RotationdirectionThe direction for drawing the radar axis and plots.protected doubleheadPercentThe head radius as a percentage of the available drawing area.private doubleinteriorGapThe space left around the outside of the plot as a percentage.private java.awt.FontlabelFontThe font used to display the category labels.private CategoryItemLabelGeneratorlabelGeneratorThe label generator.private java.awt.PaintlabelPaintThe color used to draw the category labels.private java.awt.ShapelegendItemShapeThe legend item shape.static doubleMAX_INTERIOR_GAPThe maximum interior gap (currently 40%).private doublemaxValueThe maximum value we are plotting against on each category axisprivate static longserialVersionUIDFor serialization.private java.awt.PaintseriesOutlinePaintThe outline paint for ALL series (overrides list).private PaintListseriesOutlinePaintListThe series outline paint list.private java.awt.StrokeseriesOutlineStrokeThe outline stroke for ALL series (overrides list).private StrokeListseriesOutlineStrokeListThe series outline stroke list.private java.awt.PaintseriesPaintThe paint for ALL series (overrides list).private PaintListseriesPaintListThe series paint list.private doublestartAngleThe starting angle.private CategoryToolTipGeneratortoolTipGeneratorA tooltip generator for the plot (nullpermitted).private CategoryURLGeneratorurlGeneratorA URL generator for the plot (nullpermitted).private floatwebFillAlphaThe alpha value of the fill portion of a polygon.private booleanwebFilledcontrols if the web polygons are filled or not-
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 Constructor Description SpiderWebPlot()Creates a default plot with no dataset.SpiderWebPlot(CategoryDataset dataset)Creates a new spider web plot with the given dataset, with each row representing a series.SpiderWebPlot(CategoryDataset dataset, TableOrder extract)Creates a new spider web plot with the given dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.geom.Point2DcalculateLabelLocation(java.awt.geom.Rectangle2D labelBounds, double ascent, java.awt.geom.Rectangle2D plotArea, double startAngle)Returns the location for a labelprivate voidcalculateMaxValue(int seriesCount, int catCount)loop through each of the series to get the maximum value on each category axisjava.lang.Objectclone()Returns a clone of this plot.voiddraw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, java.awt.geom.Point2D anchor, PlotState parentState, PlotRenderingInfo info)Draws the plot on a Java 2D graphics device (such as the screen or a printer).protected voiddrawLabel(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, double value, int cat, double startAngle, double extent)Draws the label for one axis.protected voiddrawRadarPoly(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.booleanequals(java.lang.Object obj)Tests this plot for equality with an arbitrary object.doublegetAxisLabelGap()Returns the axis label gap.java.awt.PaintgetAxisLinePaint()Returns the paint used to draw the axis lines.java.awt.StrokegetAxisLineStroke()Returns the stroke used to draw the axis lines.java.awt.PaintgetBaseSeriesOutlinePaint()Returns the base series paint.java.awt.StrokegetBaseSeriesOutlineStroke()Returns the base series stroke.java.awt.PaintgetBaseSeriesPaint()Returns the base series paint.TableOrdergetDataExtractOrder()Returns the data extract order (by row or by column).CategoryDatasetgetDataset()Returns the dataset.RotationgetDirection()Returns the direction in which the radar axes are drawn (clockwise or anti-clockwise).doublegetHeadPercent()Returns the head percent (the default value is 0.01).doublegetInteriorGap()Returns the interior gap, measured as a percentage of the available drawing space.java.awt.FontgetLabelFont()Returns the series label font.CategoryItemLabelGeneratorgetLabelGenerator()Returns the label generator.java.awt.PaintgetLabelPaint()Returns the series label paint.LegendItemCollectiongetLegendItems()Returns a collection of legend items for the spider web chart.java.awt.ShapegetLegendItemShape()Returns the shape used for legend items.doublegetMaxValue()Returns the maximum value any category axis can take.java.lang.StringgetPlotType()Returns a short string describing the type of plot.protected java.lang.NumbergetPlotValue(int series, int cat)Returns the value to be plotted at the intersection of the series and the category.java.awt.PaintgetSeriesOutlinePaint()Returns the outline paint for ALL series in the plot.java.awt.PaintgetSeriesOutlinePaint(int series)Returns the paint for the specified series.java.awt.StrokegetSeriesOutlineStroke()Returns the outline stroke for ALL series in the plot.java.awt.StrokegetSeriesOutlineStroke(int series)Returns the stroke for the specified series.java.awt.PaintgetSeriesPaint()Returns the paint for ALL series in the plot.java.awt.PaintgetSeriesPaint(int series)Returns the paint for the specified series.doublegetStartAngle()Returns the start angle for the first radar axis.CategoryToolTipGeneratorgetToolTipGenerator()Returns the tool tip generator for the plot.CategoryURLGeneratorgetURLGenerator()Returns the URL generator for the plot.floatgetWebFillAlpha()Returns the alpha value for filling a graph (in the range 0.0 to 1.0).protected java.awt.geom.Point2DgetWebPoint(java.awt.geom.Rectangle2D bounds, double angle, double length)Returns a cartesian point from a polar angle, length and bounding boxbooleanisWebFilled()Method to determine if the web chart is to be filled.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetAxisLabelGap(double gap)Sets the axis label gap and sends aPlotChangeEventto all registered listeners.voidsetAxisLinePaint(java.awt.Paint paint)Sets the paint used to draw the axis lines and sends aPlotChangeEventto all registered listeners.voidsetAxisLineStroke(java.awt.Stroke stroke)Sets the stroke used to draw the axis lines and sends aPlotChangeEventto all registered listeners.voidsetBaseSeriesOutlinePaint(java.awt.Paint paint)Sets the base series paint.voidsetBaseSeriesOutlineStroke(java.awt.Stroke stroke)Sets the base series stroke.voidsetBaseSeriesPaint(java.awt.Paint paint)Sets the base series paint.voidsetDataExtractOrder(TableOrder order)Sets the data extract order (by row or by column) and sends aPlotChangeEventto all registered listeners.voidsetDataset(CategoryDataset dataset)Sets the dataset used by the plot and sends aPlotChangeEventto all registered listeners.voidsetDirection(Rotation direction)Sets the direction in which the radar axes are drawn and sends aPlotChangeEventto all registered listeners.voidsetHeadPercent(double percent)Sets the head percent and sends aPlotChangeEventto all registered listeners.voidsetInteriorGap(double percent)Sets the interior gap and sends aPlotChangeEventto all registered listeners.voidsetLabelFont(java.awt.Font font)Sets the series label font and sends aPlotChangeEventto all registered listeners.voidsetLabelGenerator(CategoryItemLabelGenerator generator)Sets the label generator and sends aPlotChangeEventto all registered listeners.voidsetLabelPaint(java.awt.Paint paint)Sets the series label paint and sends aPlotChangeEventto all registered listeners.voidsetLegendItemShape(java.awt.Shape shape)Sets the shape used for legend items and sends aPlotChangeEventto all registered listeners.voidsetMaxValue(double value)Sets the maximum value any category axis can take and sends aPlotChangeEventto all registered listeners.voidsetSeriesOutlinePaint(int series, java.awt.Paint paint)Sets the paint used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.voidsetSeriesOutlinePaint(java.awt.Paint paint)Sets the outline paint for ALL series in the plot.voidsetSeriesOutlineStroke(int series, java.awt.Stroke stroke)Sets the stroke used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.voidsetSeriesOutlineStroke(java.awt.Stroke stroke)Sets the outline stroke for ALL series in the plot.voidsetSeriesPaint(int series, java.awt.Paint paint)Sets the paint used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.voidsetSeriesPaint(java.awt.Paint paint)Sets the paint for ALL series in the plot.voidsetStartAngle(double angle)Sets the starting angle and sends aPlotChangeEventto all registered listeners.voidsetToolTipGenerator(CategoryToolTipGenerator generator)Sets the tool tip generator for the plot and sends aPlotChangeEventto all registered listeners.voidsetURLGenerator(CategoryURLGenerator generator)Sets the URL generator for the plot and sends aPlotChangeEventto all registered listeners.voidsetWebFillAlpha(float alpha)Sets the alpha value for the fill of a plot polygon and sends aPlotChangeEventto all registered listeners.voidsetWebFilled(boolean flag)Sets the webFilled flag and sends aPlotChangeEventto all registered listeners.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.-
Methods inherited from class org.jfree.chart.plot.Plot
addChangeListener, annotationChanged, axisChanged, canEqual, createAndAddEntity, datasetChanged, drawBackground, 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, handleClick, hashCode, 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 Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
DEFAULT_HEAD
public static final double DEFAULT_HEAD
The default head radius percent (currently 1%).- See Also:
- Constant Field Values
-
DEFAULT_AXIS_LABEL_GAP
public static final double DEFAULT_AXIS_LABEL_GAP
The default axis label gap (currently 10%).- See Also:
- Constant Field Values
-
DEFAULT_INTERIOR_GAP
public static final double DEFAULT_INTERIOR_GAP
The default interior gap.- See Also:
- Constant Field Values
-
MAX_INTERIOR_GAP
public static final double MAX_INTERIOR_GAP
The maximum interior gap (currently 40%).- See Also:
- Constant Field Values
-
DEFAULT_START_ANGLE
public static final double DEFAULT_START_ANGLE
The default starting angle for the radar chart axes.- See Also:
- Constant Field Values
-
DEFAULT_LABEL_FONT
public static final java.awt.Font DEFAULT_LABEL_FONT
The default series label font.
-
DEFAULT_LABEL_PAINT
public static final java.awt.Paint DEFAULT_LABEL_PAINT
The default series label paint.
-
DEFAULT_LABEL_BACKGROUND_PAINT
public static final java.awt.Paint DEFAULT_LABEL_BACKGROUND_PAINT
The default series label background paint.
-
DEFAULT_LABEL_OUTLINE_PAINT
public static final java.awt.Paint DEFAULT_LABEL_OUTLINE_PAINT
The default series label outline paint.
-
DEFAULT_LABEL_OUTLINE_STROKE
public static final java.awt.Stroke DEFAULT_LABEL_OUTLINE_STROKE
The default series label outline stroke.
-
DEFAULT_LABEL_SHADOW_PAINT
public static final java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
The default series label shadow paint.
-
DEFAULT_MAX_VALUE
public static final double DEFAULT_MAX_VALUE
The default maximum value plotted - forces the plot to evaluate the maximum from the data passed in- See Also:
- Constant Field Values
-
headPercent
protected double headPercent
The head radius as a percentage of the available drawing area.
-
interiorGap
private double interiorGap
The space left around the outside of the plot as a percentage.
-
axisLabelGap
private double axisLabelGap
The gap between the labels and the axes as a %age of the radius.
-
axisLinePaint
private transient java.awt.Paint axisLinePaint
The paint used to draw the axis lines.
-
axisLineStroke
private transient java.awt.Stroke axisLineStroke
The stroke used to draw the axis lines.
-
dataset
private CategoryDataset dataset
The dataset.
-
maxValue
private double maxValue
The maximum value we are plotting against on each category axis
-
dataExtractOrder
private TableOrder dataExtractOrder
The data extract order (BY_ROW or BY_COLUMN). This denotes whether the data series are stored in rows (in which case the category names are derived from the column keys) or in columns (in which case the category names are derived from the row keys).
-
startAngle
private double startAngle
The starting angle.
-
direction
private Rotation direction
The direction for drawing the radar axis and plots.
-
legendItemShape
private transient java.awt.Shape legendItemShape
The legend item shape.
-
seriesPaint
private transient java.awt.Paint seriesPaint
The paint for ALL series (overrides list).
-
seriesPaintList
private PaintList seriesPaintList
The series paint list.
-
baseSeriesPaint
private transient java.awt.Paint baseSeriesPaint
The base series paint (fallback).
-
seriesOutlinePaint
private transient java.awt.Paint seriesOutlinePaint
The outline paint for ALL series (overrides list).
-
seriesOutlinePaintList
private PaintList seriesOutlinePaintList
The series outline paint list.
-
baseSeriesOutlinePaint
private transient java.awt.Paint baseSeriesOutlinePaint
The base series outline paint (fallback).
-
seriesOutlineStroke
private transient java.awt.Stroke seriesOutlineStroke
The outline stroke for ALL series (overrides list).
-
seriesOutlineStrokeList
private StrokeList seriesOutlineStrokeList
The series outline stroke list.
-
baseSeriesOutlineStroke
private transient java.awt.Stroke baseSeriesOutlineStroke
The base series outline stroke (fallback).
-
labelFont
private java.awt.Font labelFont
The font used to display the category labels.
-
labelPaint
private transient java.awt.Paint labelPaint
The color used to draw the category labels.
-
labelGenerator
private CategoryItemLabelGenerator labelGenerator
The label generator.
-
webFilled
private boolean webFilled
controls if the web polygons are filled or not
-
webFillAlpha
private float webFillAlpha
The alpha value of the fill portion of a polygon.
-
toolTipGenerator
private CategoryToolTipGenerator toolTipGenerator
A tooltip generator for the plot (nullpermitted).
-
urlGenerator
private CategoryURLGenerator urlGenerator
A URL generator for the plot (nullpermitted).
-
-
Constructor Detail
-
SpiderWebPlot
public SpiderWebPlot()
Creates a default plot with no dataset.
-
SpiderWebPlot
public SpiderWebPlot(CategoryDataset dataset)
Creates a new spider web plot with the given dataset, with each row representing a series.- Parameters:
dataset- the dataset (nullpermitted).
-
SpiderWebPlot
public SpiderWebPlot(CategoryDataset dataset, TableOrder extract)
Creates a new spider web plot with the given dataset.- Parameters:
dataset- the dataset.extract- controls how data is extracted (TableOrder.BY_ROWorTableOrder.BY_COLUMN).
-
-
Method Detail
-
getPlotType
public java.lang.String getPlotType()
Returns a short string describing the type of plot.- Specified by:
getPlotTypein classPlot- Returns:
- The plot type.
-
getDataset
public CategoryDataset getDataset()
Returns the dataset.- Returns:
- The dataset (possibly
null). - See Also:
setDataset(CategoryDataset)
-
setDataset
public void setDataset(CategoryDataset dataset)
Sets the dataset used by the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
dataset- the dataset (nullpermitted).- See Also:
getDataset()
-
isWebFilled
public boolean isWebFilled()
Method to determine if the web chart is to be filled.- Returns:
- A boolean.
- See Also:
setWebFilled(boolean)
-
setWebFilled
public void setWebFilled(boolean flag)
Sets the webFilled flag and sends aPlotChangeEventto all registered listeners.- Parameters:
flag- the flag.- See Also:
isWebFilled()
-
getWebFillAlpha
public float getWebFillAlpha()
Returns the alpha value for filling a graph (in the range 0.0 to 1.0).- Returns:
- The alpha value for filling a spider plot polygon.
- See Also:
setWebFillAlpha(float)
-
setWebFillAlpha
public void setWebFillAlpha(float alpha)
Sets the alpha value for the fill of a plot polygon and sends aPlotChangeEventto all registered listeners.- Parameters:
alpha- the new alpha value. If it is outside [0,1] it will be corrected to fit the range.- See Also:
getWebFillAlpha()
-
getDataExtractOrder
public TableOrder getDataExtractOrder()
Returns the data extract order (by row or by column).- Returns:
- The data extract order (never
null). - See Also:
setDataExtractOrder(TableOrder)
-
setDataExtractOrder
public void setDataExtractOrder(TableOrder order)
Sets the data extract order (by row or by column) and sends aPlotChangeEventto all registered listeners.- Parameters:
order- the order (nullnot permitted).- Throws:
java.lang.IllegalArgumentException- iforderisnull.- See Also:
getDataExtractOrder()
-
getHeadPercent
public double getHeadPercent()
Returns the head percent (the default value is 0.01).- Returns:
- The head percent (always > 0).
- See Also:
setHeadPercent(double)
-
setHeadPercent
public void setHeadPercent(double percent)
Sets the head percent and sends aPlotChangeEventto all registered listeners. Note that 0.10 is 10 percent.- Parameters:
percent- the percent (must be greater than zero).- See Also:
getHeadPercent()
-
getStartAngle
public double getStartAngle()
Returns the start angle for the first radar axis.
This is measured in degrees starting from 3 o'clock (Java Arc2D default) and measuring anti-clockwise.- Returns:
- The start angle.
- See Also:
setStartAngle(double)
-
setStartAngle
public void setStartAngle(double angle)
Sets the starting angle and sends aPlotChangeEventto 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.
- Parameters:
angle- the angle (in degrees).- See Also:
getStartAngle()
-
getMaxValue
public double getMaxValue()
Returns the maximum value any category axis can take.- Returns:
- The maximum value.
- See Also:
setMaxValue(double)
-
setMaxValue
public void setMaxValue(double value)
Sets the maximum value any category axis can take and sends aPlotChangeEventto all registered listeners.- Parameters:
value- the maximum value.- See Also:
getMaxValue()
-
getDirection
public Rotation getDirection()
Returns the direction in which the radar axes are drawn (clockwise or anti-clockwise).- Returns:
- The direction (never
null). - See Also:
setDirection(Rotation)
-
setDirection
public void setDirection(Rotation direction)
Sets the direction in which the radar axes are drawn and sends aPlotChangeEventto all registered listeners.- Parameters:
direction- the direction (nullnot permitted).- See Also:
getDirection()
-
getInteriorGap
public double getInteriorGap()
Returns the interior gap, measured as a percentage of the available drawing space.- Returns:
- The gap (as a percentage of the available drawing space).
- See Also:
setInteriorGap(double)
-
setInteriorGap
public void setInteriorGap(double percent)
Sets the interior gap and sends aPlotChangeEventto 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).- Parameters:
percent- the gap (as a percentage of the available drawing space).- See Also:
getInteriorGap()
-
getAxisLabelGap
public double getAxisLabelGap()
Returns the axis label gap.- Returns:
- The axis label gap.
- See Also:
setAxisLabelGap(double)
-
setAxisLabelGap
public void setAxisLabelGap(double gap)
Sets the axis label gap and sends aPlotChangeEventto all registered listeners.- Parameters:
gap- the gap.- See Also:
getAxisLabelGap()
-
getAxisLinePaint
public java.awt.Paint getAxisLinePaint()
Returns the paint used to draw the axis lines.- Returns:
- The paint used to draw the axis lines (never
null). - See Also:
setAxisLinePaint(Paint),getAxisLineStroke()
-
setAxisLinePaint
public void setAxisLinePaint(java.awt.Paint paint)
Sets the paint used to draw the axis lines and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getAxisLinePaint()
-
getAxisLineStroke
public java.awt.Stroke getAxisLineStroke()
Returns the stroke used to draw the axis lines.- Returns:
- The stroke used to draw the axis lines (never
null). - See Also:
setAxisLineStroke(Stroke),getAxisLinePaint()
-
setAxisLineStroke
public void setAxisLineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the axis lines and sends aPlotChangeEventto all registered listeners.- Parameters:
stroke- the stroke (nullnot permitted).- See Also:
getAxisLineStroke()
-
getSeriesPaint
public java.awt.Paint getSeriesPaint()
Returns the paint for ALL series in the plot.- Returns:
- The paint (possibly
null). - See Also:
setSeriesPaint(Paint)
-
setSeriesPaint
public void setSeriesPaint(java.awt.Paint paint)
Sets the paint for ALL series in the plot. If this is set tonull, then a list of paints is used instead (to allow different colors to be used for each series of the radar group).- Parameters:
paint- the paint (nullpermitted).- See Also:
getSeriesPaint()
-
getSeriesPaint
public java.awt.Paint getSeriesPaint(int series)
Returns the paint for the specified series.- Parameters:
series- the series index (zero-based).- Returns:
- The paint (never
null). - See Also:
setSeriesPaint(int, Paint)
-
setSeriesPaint
public void setSeriesPaint(int series, java.awt.Paint paint)Sets the paint used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.- Parameters:
series- the series index (zero-based).paint- the paint (nullpermitted).- See Also:
getSeriesPaint(int)
-
getBaseSeriesPaint
public java.awt.Paint getBaseSeriesPaint()
Returns the base series paint. This is used when no other paint is available.- Returns:
- The paint (never
null). - See Also:
setBaseSeriesPaint(Paint)
-
setBaseSeriesPaint
public void setBaseSeriesPaint(java.awt.Paint paint)
Sets the base series paint.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getBaseSeriesPaint()
-
getSeriesOutlinePaint
public java.awt.Paint getSeriesOutlinePaint()
Returns the outline paint for ALL series in the plot.- Returns:
- The paint (possibly
null).
-
setSeriesOutlinePaint
public void setSeriesOutlinePaint(java.awt.Paint paint)
Sets the outline paint for ALL series in the plot. If this is set tonull, then a list of paints is used instead (to allow different colors to be used for each series).- Parameters:
paint- the paint (nullpermitted).
-
getSeriesOutlinePaint
public java.awt.Paint getSeriesOutlinePaint(int series)
Returns the paint for the specified series.- Parameters:
series- the series index (zero-based).- Returns:
- The paint (never
null).
-
setSeriesOutlinePaint
public void setSeriesOutlinePaint(int series, java.awt.Paint paint)Sets the paint used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.- Parameters:
series- the series index (zero-based).paint- the paint (nullpermitted).
-
getBaseSeriesOutlinePaint
public java.awt.Paint getBaseSeriesOutlinePaint()
Returns the base series paint. This is used when no other paint is available.- Returns:
- The paint (never
null).
-
setBaseSeriesOutlinePaint
public void setBaseSeriesOutlinePaint(java.awt.Paint paint)
Sets the base series paint.- Parameters:
paint- the paint (nullnot permitted).
-
getSeriesOutlineStroke
public java.awt.Stroke getSeriesOutlineStroke()
Returns the outline stroke for ALL series in the plot.- Returns:
- The stroke (possibly
null).
-
setSeriesOutlineStroke
public void setSeriesOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke for ALL series in the plot. If this is set tonull, then a list of paints is used instead (to allow different colors to be used for each series).- Parameters:
stroke- the stroke (nullpermitted).
-
getSeriesOutlineStroke
public java.awt.Stroke getSeriesOutlineStroke(int series)
Returns the stroke for the specified series.- Parameters:
series- the series index (zero-based).- Returns:
- The stroke (never
null).
-
setSeriesOutlineStroke
public void setSeriesOutlineStroke(int series, java.awt.Stroke stroke)Sets the stroke used to fill a series of the radar and sends aPlotChangeEventto all registered listeners.- Parameters:
series- the series index (zero-based).stroke- the stroke (nullpermitted).
-
getBaseSeriesOutlineStroke
public java.awt.Stroke getBaseSeriesOutlineStroke()
Returns the base series stroke. This is used when no other stroke is available.- Returns:
- The stroke (never
null).
-
setBaseSeriesOutlineStroke
public void setBaseSeriesOutlineStroke(java.awt.Stroke stroke)
Sets the base series stroke.- Parameters:
stroke- the stroke (nullnot permitted).
-
getLegendItemShape
public java.awt.Shape getLegendItemShape()
Returns the shape used for legend items.- Returns:
- The shape (never
null). - See Also:
setLegendItemShape(Shape)
-
setLegendItemShape
public void setLegendItemShape(java.awt.Shape shape)
Sets the shape used for legend items and sends aPlotChangeEventto all registered listeners.- Parameters:
shape- the shape (nullnot permitted).- See Also:
getLegendItemShape()
-
getLabelFont
public java.awt.Font getLabelFont()
Returns the series label font.- Returns:
- The font (never
null). - See Also:
setLabelFont(Font)
-
setLabelFont
public void setLabelFont(java.awt.Font font)
Sets the series label font and sends aPlotChangeEventto all registered listeners.- Parameters:
font- the font (nullnot permitted).- See Also:
getLabelFont()
-
getLabelPaint
public java.awt.Paint getLabelPaint()
Returns the series label paint.- Returns:
- The paint (never
null). - See Also:
setLabelPaint(Paint)
-
setLabelPaint
public void setLabelPaint(java.awt.Paint paint)
Sets the series label paint and sends aPlotChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getLabelPaint()
-
getLabelGenerator
public CategoryItemLabelGenerator getLabelGenerator()
Returns the label generator.- Returns:
- The label generator (never
null). - See Also:
setLabelGenerator(CategoryItemLabelGenerator)
-
setLabelGenerator
public void setLabelGenerator(CategoryItemLabelGenerator generator)
Sets the label generator and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullnot permitted).- See Also:
getLabelGenerator()
-
getToolTipGenerator
public CategoryToolTipGenerator getToolTipGenerator()
Returns the tool tip generator for the plot.- Returns:
- The tool tip generator (possibly
null). - See Also:
setToolTipGenerator(CategoryToolTipGenerator)
-
setToolTipGenerator
public void setToolTipGenerator(CategoryToolTipGenerator generator)
Sets the tool tip generator for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
getToolTipGenerator()
-
getURLGenerator
public CategoryURLGenerator getURLGenerator()
Returns the URL generator for the plot.- Returns:
- The URL generator (possibly
null). - See Also:
setURLGenerator(CategoryURLGenerator)
-
setURLGenerator
public void setURLGenerator(CategoryURLGenerator generator)
Sets the URL generator for the plot and sends aPlotChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
getURLGenerator()
-
getLegendItems
public LegendItemCollection getLegendItems()
Returns a collection of legend items for the spider web chart.- Specified by:
getLegendItemsin interfaceLegendItemSource- Overrides:
getLegendItemsin classPlot- Returns:
- The legend items (never
null).
-
getWebPoint
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- Parameters:
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.- Returns:
- The cartesian point.
-
draw
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, java.awt.geom.Point2D anchor, PlotState parentState, PlotRenderingInfo info)Draws the plot on a Java 2D graphics device (such as the screen or a printer).
-
calculateMaxValue
private void calculateMaxValue(int seriesCount, int catCount)loop through each of the series to get the maximum value on each category axis- Parameters:
seriesCount- the number of seriescatCount- the number of categories
-
drawRadarPoly
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.- Parameters:
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 width
-
getPlotValue
protected java.lang.Number getPlotValue(int series, int cat)Returns the value to be plotted at the intersection of the series and the category. This allows us to plotBY_ROWorBY_COLUMNwhich basically is just reversing the definition of the categories and data series being plotted.- Parameters:
series- the series to be plotted.cat- the category within the series to be plotted.- Returns:
- The value to be plotted (possibly
null). - See Also:
getDataExtractOrder()
-
drawLabel
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.- Parameters:
g2- the graphics device.plotArea- the plot areavalue- the value of the label (ignored).cat- the category (zero-based index).startAngle- the starting angle.extent- the extent of the arc.
-
calculateLabelLocation
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- Parameters:
labelBounds- the label bounds.ascent- the ascent (height of font).plotArea- the plot areastartAngle- the start angle for the pie series.- Returns:
- The location for a label.
-
equals
public boolean equals(java.lang.Object obj)
Tests this plot for equality with an arbitrary object.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of this plot.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classPlot- Returns:
- A clone of this plot.
- Throws:
java.lang.CloneNotSupportedException- if the plot cannot be cloned for any reason.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-