From: André Wallat Date: Thu, 16 Jun 2016 11:20:54 +0000 (+0200) Subject: Fix tooltip not shown for missing dataset X-Git-Tag: v2.2.0-rc.1~27^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2789%2Fhead;p=thirdparty%2FChart.js.git 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. --- 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 {