calculateLogNiceInterval method

num calculateLogNiceInterval(
  1. num delta
)

To get the axis interval for logarithmic axis

Implementation

num calculateLogNiceInterval(num delta) {
  final List<num> intervalDivisions = <num>[10, 5, 2, 1];
  final num actualDesiredIntervalCount =
      _axisDetails.calculateDesiredIntervalCount(
          _axisDetails.axisSize, _axisDetails.axisRenderer);
  num niceInterval = delta;
  final num minInterval =
      math.pow(10, calculateLogBaseValue(niceInterval, 10).floor());
  for (int i = 0; i < intervalDivisions.length; i++) {
    final num interval = intervalDivisions[i];
    final num currentInterval = minInterval * interval;
    if (actualDesiredIntervalCount < (delta / currentInterval)) {
      break;
    }
    niceInterval = currentInterval;
  }
  return niceInterval;
}