Package 

Class PercentFormatter

  • All Implemented Interfaces:
    com.github.mikephil.charting.formatter.IAxisValueFormatter , com.github.mikephil.charting.formatter.IValueFormatter

    
    public class PercentFormatter
     implements IValueFormatter, IAxisValueFormatter
                        

    This IValueFormatter is just for convenience and simply puts a "%" sign after each value. (Recommeded for PieChart)

    • Constructor Detail

      • PercentFormatter

        PercentFormatter()
      • PercentFormatter

        PercentFormatter(DecimalFormat format)
        Allow a custom decimal format
    • Method Detail

      • getFormattedValue

         String getFormattedValue(Float value, Entry entry, Integer dataSetIndex, ViewPortHandler viewPortHandler)

        Called when a value (from labels inside the chart) is formatted before being drawn. For performance reasons, avoid excessive calculations and memory allocations inside this method.

        Parameters:
        value - the value to be formatted
        entry - the entry the value belongs to - in e.g.
        dataSetIndex - the index of the DataSet the entry in focus belongs to
        viewPortHandler - provides information about the current chart state (scale, translation, ...
      • getFormattedValue

         String getFormattedValue(Float value, AxisBase axis)

        Called when a value from an axis is to be formatted before being drawn. For performance reasons, avoid excessive calculations and memory allocations inside this method.

        Parameters:
        value - the value to be formatted
        axis - the axis the value belongs to