From edbb2356680f5c2726e9d6b7582a54b46cdb3578 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Sun, 31 May 2015 20:16:04 -0400 Subject: [PATCH] Tooltip titles now work in the line chart. Getting ever closer to being done --- samples/line.html | 4 +++- src/Chart.Core.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/line.html b/samples/line.html index 7655abe7a..2a1794284 100644 --- a/samples/line.html +++ b/samples/line.html @@ -50,7 +50,9 @@ data: lineChartData, options: { responsive: true, - hoverMode: 'label', + hover: { + mode: 'label', + }, stacked: false, scales: { xAxes: [{ diff --git a/src/Chart.Core.js b/src/Chart.Core.js index 3a5adf38a..e9b27caf9 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -1598,7 +1598,7 @@ x: medianPosition.x, y: medianPosition.y, labels: labels, - title: this._active.length ? this._active[0].label : '', + title: this._data.labels && this._data.labels.length ? this._data.labels[this._active[0]._index] : '', legendColors: colors, legendBackgroundColor: this._options.tooltips.multiKeyBackground, });