Tooltip format
-
Hi,
just an idea for improvement. How about adding an option to add extra character/information to the tooltip.
Use case:
I have a pie chart, where my dataset values are set in percents. What would I like to, is to simply add there a “%” percentage sign to the tooltip. So that it is clear what type of value is chart representing.
I have made it work by manually adding ” %” to chart.min.js:tooltip: {
callbacks: {
title: () => "",
label(t) {
let e = t.label;
const i = ": " + t.formattedValue + " %";
return Y(e) ? ((e = e.slice()), (e[0] += i)) : (e += i), e;
},
},
},But that would be obviously overwritten in next update and also one might not want to have it displayed in every chart.
Would be great if you could add this option 🙂Thank you for great plugin.
Matej
You must be logged in to reply to this topic.