From 84eb9441d5e2e5567e8f2a4f15f103b7dbc30e01 Mon Sep 17 00:00:00 2001 From: Kevin Pliester Date: Mon, 7 Sep 2020 18:40:15 +0200 Subject: [PATCH] 4.3.1 --- core/assets/js/admin.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/assets/js/admin.js b/core/assets/js/admin.js index 4567600..529f742 100644 --- a/core/assets/js/admin.js +++ b/core/assets/js/admin.js @@ -67,7 +67,7 @@ // show percentages on doughnuts // since 4.0.1 - if ('doughnut' === response.type) { + if ("doughnut" === response.type) { response.options.tooltips = { callbacks: { label: function (tooltipItem, data) { @@ -93,7 +93,9 @@ var total = 0; var pro = data.datasets[0].data[tooltipItem.index]; var contra = data.datasets[1].data[tooltipItem.index]; - var total = pro + contra; + + total = pro + contra; + var dataset = data.datasets[tooltipItem.datasetIndex]; var currentValue = dataset.data[tooltipItem.index]; var percentage = parseFloat((currentValue / total * 100).toFixed(1)); @@ -104,7 +106,7 @@ return data.labels[tooltipItem[0].index]; }, } - } + }; } new Chart(canvas, response);