Chart.js: How to show the YAxis scale in this format with K(Thousand), M(Million) and B(Billion) in Chart.Js?

Created on 5 May 2016  ·  3Comments  ·  Source: chartjs/Chart.js

1


How to show the YAxis scale in this format with K(Thousand), M(Million) and B(Billion) in Chart.Js?
in Bar chart

Most helpful comment

I just add this one,
options: { scales: { yAxes: [{ ticks: { // max: 5, min: 200000, stepSize: 200000, callback : function(value,index,array) { return (value < 1000000) ? value/1000 + 'K' : value/1000000 + 'M'; } } }] } }

All 3 comments

See #2311

Is there any solution ?

I just add this one,
options: { scales: { yAxes: [{ ticks: { // max: 5, min: 200000, stepSize: 200000, callback : function(value,index,array) { return (value < 1000000) ? value/1000 + 'K' : value/1000000 + 'M'; } } }] } }

Was this page helpful?
0 / 5 - 0 ratings