Class LogAxis

java.lang.Object
com.codename1.ui.chart.axis.Axis
com.codename1.ui.chart.axis.LogAxis

public class LogAxis extends Axis

A base 10 logarithmic axis for data spanning orders of magnitude. Values at or below zero cannot be placed and are clamped to the bottom of the axis.

A log axis

  • Constructor Details

    • LogAxis

      public LogAxis(int position)

      Creates a logarithmic axis.

      Parameters
      • position: one of Axis.BOTTOM, Axis.LEFT, Axis.RIGHT or Axis.TOP
  • Method Details

    • adjustBounds

      protected double[] adjustBounds(double min, double max)
      Description copied from class: Axis

      Lets a subclass pad or round the automatic bounds; the default rounds a numeric range outward to the nearest nice step so the outermost grid lines sit on the plot edge.

      Parameters
      • min: the raw minimum

      • max: the raw maximum

      Returns

      {min, max} to use

      Overrides:
      adjustBounds in class Axis
    • forward

      protected double forward(double value)
      Description copied from class: Axis
      Maps a value into the space the axis is linear in; the identity here, log10 for a logarithmic axis. Zoom, pan and normalization all work in this space.
      Overrides:
      forward in class Axis
    • inverse

      protected double inverse(double t)
      Description copied from class: Axis
      The inverse of forward.
      Overrides:
      inverse in class Axis
    • ticks

      public double[] ticks(int maxCount)
      Description copied from class: Axis

      Ticks for the visible range.

      Parameters
      • maxCount: the most ticks the measured label size allows
      Returns

      ascending tick values

      Overrides:
      ticks in class Axis
    • defaultFormat

      protected String defaultFormat(double value, double step)
      Description copied from class: Axis
      The axis' built in formatting; numbers are grouped and localized.
      Overrides:
      defaultFormat in class Axis