From 1fa3768386b9647c4f526965baeb803c9e02a0ab Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 20 Oct 2019 20:51:39 -0700 Subject: [PATCH] Fix autoskip for first segment of chart --- src/core/core.scale.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 6a5f7bf012b..a01a41a016c 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -305,7 +305,13 @@ function skip(ticks, spacing, majorStart, majorEnd) { } next = start; - for (i = Math.max(start, 0); i < end; i++) { + + while (next < 0) { + count++; + next = Math.round(start + count * spacing); + } + + for (i = next; i < end; i++) { tick = ticks[i]; if (i === next) { tick._index = i;