@fillah wrote:
Hey guys.
I'm using chart.js and trying to format the y-axis label from 25000 to 25.000 $.
I've read several pages about either set the default to this:Chart.defaults.global.scaleLabel = function(label){ return label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); };
or set the options:
var options = { animation: false, scaleLabel: function(label){return ' $' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");} };
or scope the options on html with options="options". But nothing works. Some of my code looks line thise, where i define the data and type of the chart.
var loadCharts = function(){ var ctx = document.getElementById("lineChart"); var myChart = new Chart(ctx, { type: 'line', data: data });; };
Posts: 1
Participants: 1