Class PieChart


  • public class PieChart
    extends Chart
    A simple pie chart.

    The values do not have to be in percentage; the percentage is computed based on the series values. If the user clicks on the slice, a popup shows the corresponding value. By setting the legendValueSuffix to "%", the value displayed will be the percentage instead of the serie's value.
    • Field Detail

      • distanceOfSelectedPie

        public int distanceOfSelectedPie
        Specifies the distance that the selected pie will be placed from the rest of the pie. Defaults to fmH.
      • selectedSeries

        public int selectedSeries
        Specifies the selected pie.
      • legendValueSuffix

        public java.lang.String legendValueSuffix
        The suffix used in the legend to display the values. E.G.: "%". Defaults to blank.
      • showValuesOnLegend

        public boolean showValuesOnLegend
        Set to true to show the values in the legend.
      • perspectiveH

        public int perspectiveH
        Perspective horizontal distance.
      • perspectiveV

        public int perspectiveV
        Perspective vertical distance.
      • selectedSlice

        public int selectedSlice
        GAO: keeps track of the currently selected slice
      • offsetSelectedSlice

        public boolean offsetSelectedSlice
        GAO: if true, then offset selected pie slice, for visual indicator that its been selected
    • Constructor Detail

      • PieChart

        public PieChart()
        Creates a new Pie chart. The yDecimalPlaces defines the number of decimal places used to display the value in the legend.
    • Method Detail

      • onPaint

        public void onPaint​(Graphics g)
        Description copied from class: Control
        Called to draw the control. When this method is called, the graphics object passed has been translated into the coordinate system of the control and the area behind the control has already been painted.
        Overrides:
        onPaint in class Control
        Parameters:
        g - the graphics object for drawing
        See Also:
        Graphics
      • onEvent

        public void onEvent​(Event e)
        Description copied from class: Control
        Called to process key, pen, control and other posted events.
        Overrides:
        onEvent in class Control
        Parameters:
        e - the event to process
        See Also:
        Event, KeyEvent, PenEvent
      • onFontChanged

        public void onFontChanged()
        Description copied from class: Control
        Called after a setFont
        Overrides:
        onFontChanged in class Control