Class NoSelectedDatasetTicksCallback

  • All Implemented Interfaces:
    TickCallback

    public final class NoSelectedDatasetTicksCallback
    extends Object
    implements TickCallback
    Implementation of tick callback in order to avoid that when all datasets are hidden, the ticks will get a wrong double precision.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_PRECISION

        public static final int DEFAULT_PRECISION
        Default precision, 1.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NoSelectedDatasetTicksCallback

        public NoSelectedDatasetTicksCallback()
        Creates the callback using the DEFAULT_PRECISION.
      • NoSelectedDatasetTicksCallback

        public NoSelectedDatasetTicksCallback​(int precision)
        Creates the callback using the argument as amount of decimals places to apply to ticks.
        Parameters:
        precision - amount of decimals places
    • Method Detail

      • getPrecision

        public int getPrecision()
        Returns the precision applied to ticks.
        Returns:
        the precision applied to ticks.
      • onCallback

        public String onCallback​(Axis axis,
                                 double value,
                                 int index,
                                 List<Double> values)
        Description copied from interface: TickCallback
        Changes the tick marks to include information about the data type.
        Specified by:
        onCallback in interface TickCallback
        Parameters:
        axis - axis instance where this callback as been defined
        value - value of tick
        index - index of tick
        values - list of all tick values
        Returns:
        the tick to apply or if the callback returns null the associated grid line will be hidden.
        It can return a List of strings (for multiple lines) or a string (for single line).