From 2dcb6d6ed55cd2781806015336257cf60a62d8ff Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Mon, 16 Oct 2017 12:24:56 +1000 Subject: [PATCH] Fix wrong ticks distribution when time.min and/or time.max are beyond the visible part of a chart. --- src/scales/scale.time.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 27a340a3b1f..af3516425d1 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -548,8 +548,8 @@ module.exports = function(Chart) { if (timestamps.length) { timestamps = arrayUnique(timestamps).sort(sorter); - min = Math.min(min, timestamps[0]); - max = Math.max(max, timestamps[timestamps.length - 1]); + min = min === MAX_INTEGER ? timestamps[0] : min; + max = max === MIN_INTEGER ? timestamps[timestamps.length - 1] : max; } // In case there is no valid min/max, let's use today limits