How to display y-axis with constant data

I have a column chart with a high graph, because at some point the y axis data is displayed as [1000,2000,3000,4000] and several times as [1k, 2k, 3k, 4k].

How can I fix it for one data type.

Regards, Naveen Leon

+6
source share
3 answers

Compare http://jsfiddle.net/BNFe5/

The difference is here:

yAxis: { labels: { formatter: function() { return this.value; } } }, 
+11
source

Converting yaxis values ​​to 1k, 2k, 3k, 4k, etc.:

 yAxis: { labels: { formatter: function() { return Math.round(this.value/1000) + 'k'; } } }, 
+5
source

If you use thousands and millions in one diagram, check this out.

 yAxis: { labels: { formatter: function () { if (this.value.toFixed(0) >= 1000000) { return '$' + this.value.toFixed(0) / 1000000 + 'M'; } else { return '$' + this.value.toFixed(0) / 1000 + 'K'; } } }, title: { text: '' } }, 
+2
source

Source: https://habr.com/ru/post/909672/


All Articles