From 60f24267747e44fad6efa6c0e908ba4ecf4add30 Mon Sep 17 00:00:00 2001 From: Tanner Linsley Date: Fri, 23 Oct 2015 12:40:56 -0600 Subject: [PATCH] Only use active datasets in the tooltip body --- src/core/core.tooltip.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(); -- 2.47.2