Class SpiderWebPlot

    • 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 (null permitted).
      • SpiderWebPlot

        public SpiderWebPlot​(CategoryDataset dataset,
                             org.jfree.util.TableOrder extract)
        Creates a new spider web plot with the given dataset.
        Parameters:
        dataset - the dataset.
        extract - controls how data is extracted (TableOrder.BY_ROW or TableOrder.BY_COLUMN).
    • Method Detail

      • getPlotType

        public java.lang.String getPlotType()
        Returns a short string describing the type of plot.
        Specified by:
        getPlotType in class Plot
        Returns:
        The plot type.
      • setDataExtractOrder

        public void setDataExtractOrder​(org.jfree.util.TableOrder order)
        Sets the data extract order (by row or by column) and sends a PlotChangeEventto all registered listeners.
        Parameters:
        order - the order (null not permitted).
        Throws:
        java.lang.IllegalArgumentException - if order is null.
        See Also:
        getDataExtractOrder()
      • 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 a 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.

        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 a PlotChangeEvent to all registered listeners.
        Parameters:
        value - the maximum value.
        See Also:
        getMaxValue()
      • getDirection

        public org.jfree.util.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​(org.jfree.util.Rotation direction)
        Sets the direction in which the radar axes are drawn and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        direction - the direction (null not 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 a 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).
        Parameters:
        percent - the gap (as a percentage of the available drawing space).
        See Also:
        getInteriorGap()
      • setAxisLinePaint

        public void setAxisLinePaint​(java.awt.Paint paint)
        Sets the paint used to draw the axis lines and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        Since:
        1.0.4
        See Also:
        getAxisLinePaint()
      • setAxisLineStroke

        public void setAxisLineStroke​(java.awt.Stroke stroke)
        Sets the stroke used to draw the axis lines and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        stroke - the stroke (null not permitted).
        Since:
        1.0.4
        See Also:
        getAxisLineStroke()
      • setSeriesPaint

        public void setSeriesPaint​(java.awt.Paint paint)
        Sets the paint for ALL series in the plot. If this is set to null, 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 (null permitted).
        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 a PlotChangeEvent to all registered listeners.
        Parameters:
        series - the series index (zero-based).
        paint - the paint (null permitted).
        See Also:
        getSeriesPaint(int)
      • setBaseSeriesPaint

        public void setBaseSeriesPaint​(java.awt.Paint paint)
        Sets the base series paint.
        Parameters:
        paint - the paint (null not 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 to null, then a list of paints is used instead (to allow different colors to be used for each series).
        Parameters:
        paint - the paint (null permitted).
      • 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 a PlotChangeEvent to all registered listeners.
        Parameters:
        series - the series index (zero-based).
        paint - the paint (null permitted).
      • 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 (null not 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 to null, then a list of paints is used instead (to allow different colors to be used for each series).
        Parameters:
        stroke - the stroke (null permitted).
      • 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 a PlotChangeEvent to all registered listeners.
        Parameters:
        series - the series index (zero-based).
        stroke - the stroke (null permitted).
      • 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 (null not permitted).
      • setLabelFont

        public void setLabelFont​(java.awt.Font font)
        Sets the series label font and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        font - the font (null not permitted).
        See Also:
        getLabelFont()
      • setLabelPaint

        public void setLabelPaint​(java.awt.Paint paint)
        Sets the series label paint and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the paint (null not permitted).
        See Also:
        getLabelPaint()
      • 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).
        Specified by:
        draw in class Plot
        Parameters:
        g2 - the graphics device.
        area - the area within which the plot should be drawn.
        anchor - the anchor point (null permitted).
        parentState - the state from the parent plot, if there is one.
        info - collects info about the drawing.
      • 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 axes
        info - chart rendering info.
        series - the series within the dataset we are plotting
        catCount - the number of categories per radar plot
        headH - the data point height
        headW - the data point width
      • getPlotValue

        protected java.lang.Number getPlotValue​(int series,
                                                int cat)
        Returns the value to be plotted at the interseries of the series and the category. This allows us to plot BY_ROW or BY_COLUMN which 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 area
        value - 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 area
        startAngle - 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.
        Overrides:
        equals in class Plot
        Parameters:
        obj - the object (null permitted).
        Returns:
        A boolean.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of this plot.
        Specified by:
        clone in interface org.jfree.util.PublicCloneable
        Overrides:
        clone in class Plot
        Returns:
        A clone of this plot.
        Throws:
        java.lang.CloneNotSupportedException - if the plot cannot be cloned for any reason.