Class MultiplePiePlot

java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.MultiplePiePlot
All Implemented Interfaces:
Serializable, Cloneable, EventListener, AnnotationChangeListener, AxisChangeListener, MarkerChangeListener, LegendItemSource, PublicCloneable, DatasetChangeListener

public class MultiplePiePlot
extends Plot
implements Cloneable, Serializable
A plot that displays multiple pie plots using data from a CategoryDataset.
See Also:
Serialized Form
  • Constructor Details

  • Method Details

    • getDataset

      Returns the dataset used by the plot.
      Returns:
      The dataset (possibly null).
    • setDataset

      public void setDataset​(CategoryDataset dataset)
      Sets the dataset used by the plot and sends a PlotChangeEvent to all registered listeners.
      Parameters:
      dataset - the dataset (null permitted).
    • getPieChart

      Returns the pie chart that is used to draw the individual pie plots. Note that there are some attributes on this chart instance that will be ignored at rendering time (for example, legend item settings).
      Returns:
      The pie chart (never null).
      See Also:
      setPieChart(JFreeChart)
    • setPieChart

      public void setPieChart​(JFreeChart pieChart)
      Sets the chart that is used to draw the individual pie plots. The chart's plot must be an instance of PiePlot.
      Parameters:
      pieChart - the pie chart (null not permitted).
      See Also:
      getPieChart()
    • getDataExtractOrder

      Returns the data extract order (by row or by column).
      Returns:
      The data extract order (never null).
    • setDataExtractOrder

      public void setDataExtractOrder​(TableOrder order)
      Sets the data extract order (by row or by column) and sends a PlotChangeEvent to all registered listeners.
      Parameters:
      order - the order (null not permitted).
    • getLimit

      public double getLimit()
      Returns the limit (as a percentage) below which small pie sections are aggregated.
      Returns:
      The limit percentage.
    • setLimit

      public void setLimit​(double limit)
      Sets the limit below which pie sections are aggregated. Set this to 0.0 if you don't want any aggregation to occur.
      Parameters:
      limit - the limit percent.
    • getAggregatedItemsKey

      Returns the key for aggregated items in the pie plots, if there are any. The default value is "Other".
      Returns:
      The aggregated items key.
    • setAggregatedItemsKey

      public void setAggregatedItemsKey​(Comparable key)
      Sets the key for aggregated items in the pie plots. You must ensure that this doesn't clash with any keys in the dataset.
      Parameters:
      key - the key (null not permitted).
    • getAggregatedItemsPaint

      Returns the paint used to draw the pie section representing the aggregated items. The default value is {code Color.LIGHT_GRAY}.
      Returns:
      The paint.
    • setAggregatedItemsPaint

      public void setAggregatedItemsPaint​(Paint paint)
      Sets the paint used to draw the pie section representing the aggregated items and sends a PlotChangeEvent to all registered listeners.
      Parameters:
      paint - the paint (null not permitted).
    • getPlotType

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

      Returns the shape used for legend items.
      Returns:
      The shape (never null).
      See Also:
      setLegendItemShape(Shape)
    • setLegendItemShape

      public void setLegendItemShape​(Shape shape)
      Sets the shape used for legend items and sends a PlotChangeEvent to all registered listeners.
      Parameters:
      shape - the shape (null not permitted).
      See Also:
      getLegendItemShape()
    • draw

      public void draw​(Graphics2D g2, Rectangle2D area, 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.
    • getLegendItems

      Returns a collection of legend items for the pie chart.
      Specified by:
      getLegendItems in interface LegendItemSource
      Overrides:
      getLegendItems in class Plot
      Returns:
      The legend items.
    • equals

      public boolean equals​(Object obj)
      Tests this plot for equality with an arbitrary object. Note that the plot's dataset is not considered in the equality test.
      Overrides:
      equals in class Plot
      Parameters:
      obj - the object (null permitted).
      Returns:
      true if this plot is equal to obj, and false otherwise.
    • clone

      Returns a clone of the plot.
      Specified by:
      clone in interface PublicCloneable
      Overrides:
      clone in class Plot
      Returns:
      A clone.
      Throws:
      CloneNotSupportedException - if some component of the plot does not support cloning.