Class ZAxis


  • public final class ZAxis
    extends Axis
    A subclass of Axis which can only be used on the Z-axis of a graph. Use it like so:
      AxesGraph graph = new AxesGraph();
      graph.setAxis(Axis.ZAXIS, new ZAxis());
     
    Attempting to use a ZAxis on any axis other than the Z axis will result in an Exception
    • Constructor Detail

      • ZAxis

        public ZAxis()
        Create a new ZAxis
    • Method Detail

      • format

        public String format​(double in)
        Description copied from class: Axis

        Given the specified number, return the text that should be placed against the tooth at that position. For example, an Axis that simply plotted integer values might return Integer.toString((int)in)

        Those wanting to create their own custom axis will typically override this method and Axis.steps(double, double).

        Specified by:
        format in class Axis
        Parameters:
        in - the value to format
        Returns:
        the value formatted as a String
      • steps

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

        The steps method controls where the teeth are placed on the spine. Each subclass of Axis has a different strategy - for instance, the DateAxis will try and place ticks on the 1st of the month, the NumericAxis will try and place them evenly across the range and so on.

        The returned array should consist of a range of numbers, ordered from low to high, which mark the locations of the teeth on the spine. min and max are the minimum and maximum values of the data to plot, and these values will usually be the first and last values in the returned array.

        Those wanting to create their own custom axis will typically override this method and Axis.format(double).

        Specified by:
        steps in class Axis
        Parameters:
        min - the minimum value of the data to plot
        max - the maximum value of the data to plot
        Returns:
        an array of doubles representing the positions to place teeth on this axis