From 4c35bba63941b2909aed37223048401329a64df2 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Mon, 15 Feb 2016 10:43:19 -0500 Subject: [PATCH] When the last label would overlap with the previously shown label, skip the previously shown one --- src/core/core.scale.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 3e754afcc..a7475f1b8 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -484,7 +484,9 @@ module.exports = function(Chart) { helpers.each(this.ticks, function(label, index) { // Blank ticks var isLastTick = this.ticks.length === index + 1; - var shouldSkip = skipRatio > 1 && index % skipRatio > 0; + + // Since we always show the last tick,we need may need to hide the last shown one before + var shouldSkip = (skipRatio > 1 && index % skipRatio > 0) || (index % skipRatio === 0 && index + skipRatio > this.ticks.length); if (shouldSkip && !isLastTick || (label === undefined || label === null)) { return; } -- 2.47.2