React-chartjs-2: Number format for Y-axis data

Created on 31 Aug 2018  路  1Comment  路  Source: reactchartjs/react-chartjs-2

I am Using Bar and have number for data section which are shown against Y-axis.
How can I format the number display?
e.g For Y-axis when I have 2034 I want to display like 2,034.

Most helpful comment

I found the way using following:
ticks: {
callback: function(label, index, labels) {
return label.toLocaleString(navigator.language, { minimumFractionDigits: 0 });
}
}

>All comments

I found the way using following:
ticks: {
callback: function(label, index, labels) {
return label.toLocaleString(navigator.language, { minimumFractionDigits: 0 });
}
}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Holychung picture Holychung  路  4Comments

souuu picture souuu  路  4Comments

RamonBeast picture RamonBeast  路  4Comments

davidcalhoun picture davidcalhoun  路  5Comments

flavz27 picture flavz27  路  5Comments