From 6c9f202c6835d60fbaa220cbfab99b9946aae999 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 24 Oct 2019 16:21:05 -0700 Subject: [PATCH] Fix autoskip for first segment of chart (#6584) * Fix autoskip for first segment of chart * Fix issue identified during review --- src/core/core.scale.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index b4553a86a..f292bd2c2 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -305,6 +305,12 @@ function skip(ticks, spacing, majorStart, majorEnd) { } next = start; + + while (next < 0) { + count++; + next = Math.round(start + count * spacing); + } + for (i = Math.max(start, 0); i < end; i++) { tick = ticks[i]; if (i === next) { -- 2.47.3