I found this code on stakoverflow for my chart with charts.js. I need to set as format of my string of value the euro(€) currency, but if I put the € instead of the $, it gets rendered in a strange way and on my chart appears what it is on the image.
scales: {
yAxes: [{
stacked: true,
gridLines: {
display: true,
color: "rgba(255,99,132,0.2)",
},
ticks: {
fontSize: 18,
fontColor: 'rgba(159, 220, 141, 0.7)',
userCallback: function(value, index, values) {
// Convert the number to a string and splite the string every 3 charaters from the end
value = value.toString();
value = value.split(/(?=(?:...)*$)/);
// Convert the array to a string and format the output
value = value.join('.');
return '$ ' + value;
}}
Thank you in advance for your help.