From b8e57144ccfd6bcdf315cec61635b61efcd32d30 Mon Sep 17 00:00:00 2001 From: etimberg Date: Fri, 30 Oct 2015 20:48:31 -0400 Subject: [PATCH] Doughnut chart tooltips work --- src/controllers/controller.doughnut.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js index 1188a7c2b..7e724d15c 100644 --- a/src/controllers/controller.doughnut.js +++ b/src/controllers/controller.doughnut.js @@ -18,6 +18,16 @@ }, //The percentage of the chart that we cut out of the middle. cutoutPercentage: 50, + + // Need to override these to give a nice default + tooltips: { + callbacks: { + title: function() { return '' }, + label: function(tooltipItem, data) { + return data.labels[tooltipItem.index] + ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]; + } + } + } }; Chart.defaults.pie = helpers.clone(Chart.defaults.doughnut);