From: etimberg Date: Tue, 1 Sep 2015 01:49:51 +0000 (-0400) Subject: If the element has a label, use that in the tooltip instead of the dataset label. X-Git-Tag: 2.0.0-alpha4~31^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1430%2Fhead;p=thirdparty%2FChart.js.git If the element has a label, use that in the tooltip instead of the dataset label. --- diff --git a/src/core/core.tooltip.js b/src/core/core.tooltip.js index 90539681a..3f4a892c4 100644 --- a/src/core/core.tooltip.js +++ b/src/core/core.tooltip.js @@ -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] : '', }), });