mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-02-01 17:47:09 +00:00
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:
parent
36d992027c
commit
79773b7243
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user