]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
If the element has a label, use that in the tooltip instead of the dataset label. 1430/head
authoretimberg <evert.timberg@gmail.com>
Tue, 1 Sep 2015 01:49:51 +0000 (21:49 -0400)
committeretimberg <evert.timberg@gmail.com>
Tue, 1 Sep 2015 01:49:51 +0000 (21:49 -0400)
src/core/core.tooltip.js

index 90539681a64a8bc1c835b011a90653020207dae9..3f4a892c41a11ba2c9ebefb7cb3b085367502457 100644 (file)
@@ -80,7 +80,7 @@
                                                        // These variables are available in the template function. Add others here
                                                        element: this._active[0],
                                                        value: this._data.datasets[this._active[0]._datasetIndex].data[this._active[0]._index],
-                                                       label: this._data.labels ? this._data.labels[this._active[0]._index] : '',
+                                                       label: this._active[0]._model.label !== undefined ? this._active[0]._model.label : this._data.labels ? this._data.labels[this._active[0]._index] : '',
                                                }),
                                        });