From 8d88e9c3b75f5d3319c01c631025a36927b29446 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Fri, 6 May 2016 07:57:28 -0400 Subject: [PATCH] Fix time scale grid lines --- src/scales/scale.time.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scales/scale.time.js b/src/scales/scale.time.js index 2feeda863..b57a09113 100644 --- a/src/scales/scale.time.js +++ b/src/scales/scale.time.js @@ -307,6 +307,7 @@ module.exports = function(Chart) { } }, convertTicksToLabels: function() { + this.tickMoments = this.ticks; this.ticks = this.ticks.map(this.tickFormatFunction, this); }, getPixelForValue: function(value, index, datasetIndex, includeOffset) { @@ -332,6 +333,9 @@ module.exports = function(Chart) { } } }, + getPixelForTick: function(index, includeOffset) { + return this.getPixelForValue(this.tickMoments[index], null, null, includeOffset); + }, getValueForPixel: function(pixel) { var innerDimension = this.isHorizontal() ? this.width - (this.paddingLeft + this.paddingRight) : this.height - (this.paddingTop + this.paddingBottom); var offset = (pixel - (this.isHorizontal() ? this.left + this.paddingLeft : this.top + this.paddingTop)) / innerDimension; -- 2.47.2