code: private void calculate() {
          if (niceScale) {
              this.niceRange = calcNiceNumber(maxValue - minValue, false);
              this.majorTickSpacing = calcNiceNumber(niceRange / (maxNoOfMajorTicks - 1), true);
              this.niceMinValue = Math.floor(minValue / majorTickSpacing) * majorTickSpacing;
              this.niceMaxValue = Math.ceil(maxValue / majorTickSpacing) * majorTickSpacing;
              this.minorTickSpacing = calcNiceNumber(majorTickSpacing / (maxNoOfMinorTicks - 1), true);
              this.range = niceMaxValue - niceMinValue;
          } else {
              this.niceRange = (maxValue - minValue);
              this.niceMinValue = minValue;
              this.niceMaxValue = maxValue;
              this.range = this.niceRange;
          }
      }
docs: Calculate and update values for majro and minor tick spacing and nice
  minimum and maximum values on the axis.