var myChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: myLabels,
datasets: [{
data: myData,
backgroundColor: palette('tol', myData.length).map(function(hex) {
return '#' + hex;
}),
hoverBorderColor: palette('tol', myData.length).map(function(hex) {
return '#' + hex;
}),
hoverBorderWidth: '20px'
}]
},
options: {
cutout:'80%',
responsive: true,
plugins: {
tooltip: {
enabled: false,
},
legend: {
display: false,
},
title: {
display: false,
}
},
onHover: function(event, activeElements){
if (activeElements.length > 0) {
var value = myChart.data.datasets[0].data[activeElements[0].index];
payment_groups_js.current = value;
var label = myChart.data.labels[activeElements[0].index];
}
else {
payment_groups_js.current = payment_groups_js.total;
}
myChart.update();
}
},
plugins: [chartAreaBorder, chartAreaBorder2, chartAreaBorder3]
});