Hi everyone
Something i missed and thus i tried to make it possible with morris was to format the number as is being shown in the chart.
Ex as a brazilian we use offten comma instead of dot to separate numbers.
This way i ca leave my chart to 'organize' the data with the normal number, ex: 1146.4 and when i need the user to see, it sees 1.146,40;
It just add a option called valueFormatter, that formatter onli the Y value(in my case i just needed it)
so i use add:
...
parseTime: false,
smooth: false,
valueFormatter: function(value) {
var negative = value < 0;
var valor = Math.abs(value);
var final = valor.toFixed(2).replace('.', ',').replace(/(\d)(?=(\d{3})+\,)/g, "$1.");
final = negative ? '-'+final:final;
return final;
}
...
Hi everyone Something i missed and thus i tried to make it possible with morris was to format the number as is being shown in the chart. Ex as a brazilian we use offten comma instead of dot to separate numbers. This way i ca leave my chart to 'organize' the data with the normal number, ex: 1146.4 and when i need the user to see, it sees 1.146,40;
It just add a option called valueFormatter, that formatter onli the Y value(in my case i just needed it) so i use add:
and the my value show as: