[SOLVED] Chart : tooltips callbacks ignored ?
Posted: 07 Jul 2022, 10:32
Hi,
I'm trying to add a percent character at the end of labels in my chart tooltip.
It works well with pure chart.js like in this fiddle : https://codepen.io/apertureless/pen/BZKBdX
But if i use it in my options for primevue compoentn, it's just ignored. Nothing in the console, no change on my tooltip (see option below).
Is PrimeVue chart handle plugin / tooltips / callbacks ? I can't find any example in documentation nor in the theme I've buy (Atlantis)
I'm trying to add a percent character at the end of labels in my chart tooltip.
It works well with pure chart.js like in this fiddle : https://codepen.io/apertureless/pen/BZKBdX
But if i use it in my options for primevue compoentn, it's just ignored. Nothing in the console, no change on my tooltip (see option below).
Is PrimeVue chart handle plugin / tooltips / callbacks ? I can't find any example in documentation nor in the theme I've buy (Atlantis)
Code: Select all
barOptions: {
interaction: {
intersect: false,
mode: 'index',
},
plugins: {
tooltips: {
mode: 'index',
intersect: false,
callbacks: {
label: ((tooltipItem, data) => {
console.log(this)
return data['labels'][tooltipItem['index']] + ': ' + data['datasets'][0]['data'][tooltipItem['index']] + '%'
}),
}
},
legend: {
labels: {
color: '#A0A7B5'
}
}
},
responsive: true,
scales: {
x: {
stacked: true,
ticks: {
color: '#A0A7B5'
},
},
y: {
stacked: true,
ticks: {
color: '#A0A7B5'
},
}
}
}