Package 

Class PieData

  • All Implemented Interfaces:
    java.io.Serializable

    
    public class PieData
    extends ChartData<IPieDataSet>
                        

    A PieData object can only represent one DataSet. Unlike all other charts, the legend labels of the PieChart are created from the x-values array, and not from the DataSet labels. Each PieData object can only represent one PieDataSet (multiple PieDataSets inside a single PieChart are not possible).

    • Method Summary

      Modifier and Type Method Description
      void setDataSet(IPieDataSet dataSet) Sets the PieDataSet this data object should represent.
      IPieDataSet getDataSet() Returns the DataSet this PieData object represents.
      List<IPieDataSet> getDataSets() Returns all DataSet objects this ChartData object holds.
      IPieDataSet getDataSetByIndex(int index) The PieData object can only have one DataSet.
      IPieDataSet getDataSetByLabel(String label, boolean ignorecase) Returns the DataSet object with the given label.
      Entry getEntryForHighlight(Highlight highlight) Get the Entry for a corresponding highlight object
      float getYValueSum() Returns the sum of all values in this PieData object.
      • Methods inherited from class com.github.mikephil.charting.data.ChartData

        addDataSet, addEntry, calcMinMaxY, clearValues, contains, getColors, getDataSetByIndex, getDataSetByLabel, getDataSetCount, getDataSetForEntry, getDataSetLabels, getDataSets, getEntryCount, getFirstRight, getIndexOfDataSet, getMaxEntryCountSet, getXMax, getXMin, getYMax, getYMax, getYMin, getYMin, isHighlightEnabled, notifyDataChanged, removeDataSet, removeDataSet, removeEntry, removeEntry, setDrawValues, setHighlightEnabled, setValueFormatter, setValueTextColor, setValueTextColors, setValueTextSize, setValueTypeface
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PieData

        PieData()
    • Method Detail

      • setDataSet

         void setDataSet(IPieDataSet dataSet)

        Sets the PieDataSet this data object should represent.

      • getDataSet

         IPieDataSet getDataSet()

        Returns the DataSet this PieData object represents. A PieData object canonly contain one DataSet.

      • getDataSetByIndex

         IPieDataSet getDataSetByIndex(int index)

        The PieData object can only have one DataSet. Use getDataSet() method instead.

      • getDataSetByLabel

         IPieDataSet getDataSetByLabel(String label, boolean ignorecase)

        Returns the DataSet object with the given label. Search can be casesensitive or not. IMPORTANT: This method does calculations at runtime.Use with care in performance critical situations.

      • getYValueSum

         float getYValueSum()

        Returns the sum of all values in this PieData object.