Class IntegerFormatter


  • public class IntegerFormatter
    extends Formatter
    The IntegerFormatter is the default formatter that's used if none of the values on the graph contains any decimal places. It formats each argument as an integer, rounding down.
    • Constructor Detail

      • IntegerFormatter

        public IntegerFormatter()
        Return a new IntegerFormatter using the Formatter.NORMAL density settings.
      • IntegerFormatter

        public IntegerFormatter​(int density)
        Return a new IntegerFormatter of the specified density - Formatter.NORMAL, Formatter.SPARSE or Formatter.MINIMAL
        Parameters:
        density - the number of steps to display on the axis
        Since:
        1.0.5
    • Method Detail

      • format

        public java.lang.String format​(double in)
        Description copied from class: Formatter
        Return a String that is the formatted version of the input parameter.
        Specified by:
        format in class Formatter
      • steps

        public double[] steps​(double min,
                              double max)
        Description copied from class: Formatter

        Which steps between min and max should be marked on the axis. This is an array because although the steps will usually be evenly spaced, they may not always be (see the DateFormatter for an example).

        This method returns the default settings, which is to calculate a number of "useful" values between min and max, possibly rounding those two values up or down to fit the scale. The number of values returned depends on the density setting.

        Overrides:
        steps in class Formatter