Package 

Interface IValueFormatter


  • 
    public interface IValueFormatter
    
                        

    Interface that allows custom formatting of all values inside the chart before they are being drawn to the screen. Simply create your own formatting class and let it implement IValueFormatter. Then override the getFormattedValue(...) method and return whatever you want.

    • Method Summary

      Modifier and Type Method Description
      abstract String getFormattedValue(Float value, Entry entry, Integer dataSetIndex, ViewPortHandler viewPortHandler) Called when a value (from labels inside the chart) is formatted before being drawn.
      • Methods inherited from class java.lang.Object

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

      • getFormattedValue

         abstract 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, ...