0👍
Since v3 the tooltip is located under plugins in options: here
This is how it looks in javaScript:
options:{
...
plugins: {
tooltip: {
callbacks: {
label: function (context) {
if (context.parsed.y !== null) {
return context.dataset.label + ": " +
new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR'
}).format(context.parsed.y);
}
return "";
}
}
}
}
...
}
For the y-axis you also can use a callback:
options:{
...
scales: {
y: {
ticks: {
callback: function (value, index, ticks) {
return new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR'
}).format(value);
}
}
}
}
...
}
Attention, note that it is called "tooltip," not "tooltips"!
- [Chartjs]-Angular 2 ng2-charts donut add text
- [Chartjs]-How to center bars on x-axis of Chart.js bar graph?
Source:stackexchange.com