Show correct title in multi series pie chart example (#11962)

Co-authored-by: Jacco van den Berg <jacco@jem-id.nl>
This commit is contained in:
Jacco van den Berg 2024-11-21 21:47:09 +01:00 committed by GitHub
parent 36d992027c
commit 79773b7243
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -74,9 +74,9 @@ const config = {
},
tooltip: {
callbacks: {
label: function(context) {
const labelIndex = (context.datasetIndex * 2) + context.dataIndex;
return context.chart.data.labels[labelIndex] + ': ' + context.formattedValue;
title: function(context) {
const labelIndex = (context[0].datasetIndex * 2) + context[0].dataIndex;
return context[0].chart.data.labels[labelIndex] + ': ' + context[0].formattedValue;
}
}
}