From: Tanner Linsley Date: Fri, 23 Oct 2015 18:40:56 +0000 (-0600) Subject: Only use active datasets in the tooltip body X-Git-Tag: 2.0.0-beta~4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1542%2Fhead;p=thirdparty%2FChart.js.git Only use active datasets in the tooltip body --- diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 29c19488a..357607637 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -222,7 +222,9 @@ yLabel = []; helpers.each(this._data.datasets, function(dataset, datasetIndex) { - + if (!helpers.isDatasetVisible(dataset)) { + return; + } xLabel.push(element._xScale.getLabelForIndex(element._index, datasetIndex)); yLabel.push(element._yScale.getLabelForIndex(element._index, datasetIndex)); }); @@ -415,6 +417,7 @@ helpers.each(vm.body, function(body, i) { + // Draw Legend-like boxes if needed if (this._options.tooltips.mode != 'single') { ctx.fillStyle = helpers.color(vm.labelColors[i].borderColor).alpha(vm.opacity).rgbString();