Class PieChart

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class PieChart extends JPanel implements PropertyChangeListener
Pie chart showing a circle with a highlighted arc representing preset share.
See Also:
  • Constructor Details

    • PieChart

      public PieChart()
      Creates a new pie chart.
  • Method Details

    • paint

      public void paint(Graphics graphics)
      Draws the pie chart given set share.
      Overrides:
      paint in class JComponent
      Parameters:
      graphics - Graphics area where the chart should be drawn.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Method called when some property of task was changed.
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      evt - Event describing what was changed.
    • setShares

      public void setShares(Vector names, Vector shares)
      Sets names and shares that should be highlighted in the pie chart.
      Parameters:
      names - Descriptions of portions to be highlighted in the pie chart.
      shares - Percentages of portions to be highlighted in the pie chart.