Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
etimberg committed Jan 14, 2018
1 parent b934ca8 commit 7126966
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/scales/scale.linearbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ function generateTicks(generationOptions, dataRange) {
// for details.

var spacing;

if (generationOptions.stepSize && generationOptions.stepSize > 0) {
spacing = generationOptions.stepSize;
} else {
var niceRange = helpers.niceNum(dataRange.max - dataRange.min, false);
spacing = helpers.niceNum(niceRange / (generationOptions.maxTicks - 1), true);

var precision = generationOptions.precision;
if (precision !== undefined) {
var spacingPrecision = generationOptions.precision;
if (spacingPrecision !== undefined) {
// If the user specified a precision, round to that number of decimal places
var factor = Math.pow(10, precision);
var factor = Math.pow(10, spacingPrecision);
spacing = Math.ceil(spacing * factor) / factor;
}
}
Expand Down

0 comments on commit 7126966

Please sign in to comment.