]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Only use active datasets in the tooltip body 1542/head
authorTanner Linsley <tannerlinsley@gmail.com>
Fri, 23 Oct 2015 18:40:56 +0000 (12:40 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Fri, 23 Oct 2015 18:41:21 +0000 (12:41 -0600)
src/core/core.tooltip.js

index 29c19488aa96b7c7da1c999ad44e6d604effa9fd..35760763710d108e266278d5f3af909748cbcfc1 100644 (file)
                                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));
                                });
 
                                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();