Class SpaceTransformedRegularTickProvider

All Implemented Interfaces:
ITickProvider

public class SpaceTransformedRegularTickProvider extends RegularTickProvider
Build a sequence of regularly spaced ticks in case of space transformed charts (e.g. log charts).
Author:
martin
  • Constructor Details

    • SpaceTransformedRegularTickProvider

      public SpaceTransformedRegularTickProvider()
    • SpaceTransformedRegularTickProvider

      public SpaceTransformedRegularTickProvider(int steps)
  • Method Details

    • generateTicks

      public double[] generateTicks(double min, double max, int steps)
      Able to generate ticks that will visually look equally spaced, despite an existing space transform in the chart. The idea is that without knowing the space transform, neither the reverse of this function, we deduce it from the min-max range by computing the stepFactor that can be used to get the following tick sequence :
      • Z0 = min
      • Z1 = Z0 * stepFactor
      • Z2 = Z1 * stepFactor
      • Z3 = max
      Solve factor equation below
      • zmax / Math.pow(stepFactor, numberOfTicks) = zmin, equivalent to
      • Math.pow(stepFactor, numberOfTicks) = zmax/zmin, equivalent to
      • stepFactor = Math.pow(zmax/zmin, 1/steps)
      • as Math.pow(x,n)=a is reversed by x=Math.pow(a,1/n)
      Specified by:
      generateTicks in interface ITickProvider
      Overrides:
      generateTicks in class RegularTickProvider