From 72f423fb95b861e37de3b2a617c123086593ee9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Wallat?= Date: Thu, 16 Jun 2016 13:20:54 +0200 Subject: [PATCH] Fix tooltip not shown for missing dataset When two datasets are shown and they don't have the same x-coordinates, then the position of the tooltip is not calculated correctly, when using mode 'label' or 'dataset'. This fix checks if the position of every dataset exists, before it is used. --- src/core/core.tooltip.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 6eb6b3a55..589d4292b 100755 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -117,8 +117,10 @@ module.exports = function(Chart) { var x = 0, y = 0; for (i = 0; i < xPositions.length; ++i) { - x += xPositions[i]; - y += yPositions[i]; + if (xPositions[ i ]) { + x += xPositions[i]; + y += yPositions[i]; + } } return {