mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 12:49:07 +02:00
Only use active datasets in the tooltip body
This commit is contained in:
parent
bc41909e7a
commit
60f2426774
@ -222,7 +222,9 @@
|
|||||||
yLabel = [];
|
yLabel = [];
|
||||||
|
|
||||||
helpers.each(this._data.datasets, function(dataset, datasetIndex) {
|
helpers.each(this._data.datasets, function(dataset, datasetIndex) {
|
||||||
|
if (!helpers.isDatasetVisible(dataset)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
xLabel.push(element._xScale.getLabelForIndex(element._index, datasetIndex));
|
xLabel.push(element._xScale.getLabelForIndex(element._index, datasetIndex));
|
||||||
yLabel.push(element._yScale.getLabelForIndex(element._index, datasetIndex));
|
yLabel.push(element._yScale.getLabelForIndex(element._index, datasetIndex));
|
||||||
});
|
});
|
||||||
@ -415,6 +417,7 @@
|
|||||||
|
|
||||||
helpers.each(vm.body, function(body, i) {
|
helpers.each(vm.body, function(body, i) {
|
||||||
|
|
||||||
|
|
||||||
// Draw Legend-like boxes if needed
|
// Draw Legend-like boxes if needed
|
||||||
if (this._options.tooltips.mode != 'single') {
|
if (this._options.tooltips.mode != 'single') {
|
||||||
ctx.fillStyle = helpers.color(vm.labelColors[i].borderColor).alpha(vm.opacity).rgbString();
|
ctx.fillStyle = helpers.color(vm.labelColors[i].borderColor).alpha(vm.opacity).rgbString();
|
||||||
|
Loading…
Reference in New Issue
Block a user