最佳答案
您需要使用标签formatter()
函数。
不过,这需要您自己创建使用缩写的逻辑。
示例:
yAxis: {
labels: {
formatter: function() {
return this.value == 0 ? 0 : this.value / 1000000000 + 'G';
}
}
}
fiddle :
更灵活的东西可能看起来像这样:
yAxis: {
labels: {
formatter: function() {
var val;
if(this.value > 1000000000 ) {
val = this.value / 1000000000 + 'B';
}
else if(this.value > 1000000) {
val = this.value / 1000000 + 'M';
}
else if(this.value > 1000) {
val = this.value / 1000 + 'k';
}
else {
val = this.value;
}
return this.value == 0 ? 0 : val;
}
}
}
更新的 fiddle :
关于javascript - 如果 highcharts y 轴上的数据为零,如何删除数据范围符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36505435/