From: Jukka Kurkela Date: Mon, 18 Nov 2019 23:45:54 +0000 (+0200) Subject: Fix tick spacing calculation (#6761) X-Git-Tag: v3.0.0-alpha~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=542f598e6d0796bfdc41af6edc317bc62b0ccfba;p=thirdparty%2FChart.js.git Fix tick spacing calculation (#6761) --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 5b59f348d..414e88b00 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -242,7 +242,7 @@ function getEvenSpacing(arr) { function calculateSpacing(majorIndices, ticks, axisLength, ticksLimit) { var evenMajorSpacing = getEvenSpacing(majorIndices); - var spacing = (ticks.length - 1) / ticksLimit; + var spacing = ticks.length / ticksLimit; var factors, factor, i, ilen; // If the major ticks are evenly spaced apart, place the minor ticks