]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Tooltip titles now work in the line chart. Getting ever closer to being done
authorEvert Timberg <evert.timberg@gmail.com>
Mon, 1 Jun 2015 00:16:04 +0000 (20:16 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Mon, 1 Jun 2015 00:16:04 +0000 (20:16 -0400)
samples/line.html
src/Chart.Core.js

index 7655abe7a9d227789a47dcb3345fe07c15071708..2a1794284ba46d214a32dc93fa7f57e121903123 100644 (file)
@@ -50,7 +50,9 @@
             data: lineChartData, 
             options: {
                 responsive: true,
-                hoverMode: 'label',
+                hover: {
+                    mode: 'label',
+                },
                 stacked: false,
                 scales: {
                     xAxes: [{
index 3a5adf38a26644b5d61596b321acc0f7409c991a..e9b27caf9abc4ffd54ede2a6371c212deefbcc44 100755 (executable)
                         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,
                     });