我如何格式化yAxis.stackLabel,将巨大的数字切成'k','M','G','T','P','E‘。我在工具提示上找到了怎么做,但是它在stackLabel上不起作用
发布于 2022-06-16 09:50:28
可以使用yAxis对堆栈标签进行更改,您需要计算值和返回格式。
yAxis: {
stackLabels: {
style: {
color: 'black'
},
enabled: true,
formatter: function() {
let value = this.total;
if (value > 1000) {
return Math.floor(value / 1000) + ' k'
} else {
return value
}
}
}
},https://stackoverflow.com/questions/72631182
复制相似问题