I have a ChartJS (v2) bubble chart with three dimensions: x, y, and r (radius of the bubble).
Following this answer, I have this code for customizing the tooltip:
tooltips: {
callbacks: {
label: function (tooltipItem, data) {
var datasetLabel = data.datasets[tooltipItem.datasetIndex].label || '';
return datasetLabel + ' : ' + tooltipItem.rLabel + '% has price of ' + tooltipItem.yLabel + ' USD';
}
}
}
It almost works except that tooltipItem.rLabel
is displayed as undefined
. If I input tooltipItem.xLabel
the tooltip displays correctly with the value of x
. However, I want to display the value of r
.
Does anyone know a solution for this?