diff --git a/src/scales/scale.linear.js b/src/scales/scale.linear.js index 94ebd12a5a0..aa723004fb7 100644 --- a/src/scales/scale.linear.js +++ b/src/scales/scale.linear.js @@ -170,11 +170,10 @@ module.exports = function(Chart) { if (me.isHorizontal()) { pixel = me.left + (me.width / range * (rightValue - start)); - return Math.round(pixel); + } else { + pixel = me.bottom - (me.height / range * (rightValue - start)); } - - pixel = me.bottom - (me.height / range * (rightValue - start)); - return Math.round(pixel); + return pixel; }, getValueForPixel: function(pixel) { var me = this; diff --git a/test/specs/core.controller.tests.js b/test/specs/core.controller.tests.js index 3ec8da50b76..b2615f14eec 100644 --- a/test/specs/core.controller.tests.js +++ b/test/specs/core.controller.tests.js @@ -759,8 +759,8 @@ describe('Chart', function() { // Verify that points are at their initial correct location, // then we will reset and see that they moved - expect(meta.data[0]._model.y).toBe(333); - expect(meta.data[1]._model.y).toBe(183); + expect(meta.data[0]._model.y).toBeCloseToPixel(333); + expect(meta.data[1]._model.y).toBeCloseToPixel(183); expect(meta.data[2]._model.y).toBe(32); expect(meta.data[3]._model.y).toBe(484); diff --git a/test/specs/core.tooltip.tests.js b/test/specs/core.tooltip.tests.js index c0a162968b1..8878d9d9dbc 100755 --- a/test/specs/core.tooltip.tests.js +++ b/test/specs/core.tooltip.tests.js @@ -764,7 +764,7 @@ describe('Core.Tooltip', function() { it('Should not update if active element has not changed', function() { var chart = window.acquireChart({ - type: 'bar', + type: 'line', data: { datasets: [{ label: 'Dataset 1',