nice method

  1. @override
PowerScale nice([
  1. int count = 10
])
override

Returns nicely rounded domain values.

Implementation

@override
PowerScale nice([int count = 10]) {
  final d = _domain;
  final start = d.first;
  final stop = d.last;

  final step = tickStep(start, stop, count);
  if (step > 0) {
    _domain[0] = (start / step).floor() * step;
    _domain[_domain.length - 1] = (stop / step).ceil() * step;
  }

  return this;
}