nice method

TimeScale nice([
  1. int count = 10
])

Returns nicely rounded domain values.

Implementation

TimeScale nice([int count = 10]) {
  final span = _domain.last.difference(_domain.first);
  final interval = _selectInterval(span, count);

  _domain[0] = _floorToInterval(_domain[0], interval);
  _domain[_domain.length - 1] = _ceilToInterval(_domain.last, interval);

  return this;
}