我想在仪表数据标签上显示一些数字,如下所示:

我尝试使用category和这样的formatter选项, yAxis但faild!
categories: ['0','3','7','14'],
Run Code Online (Sandbox Code Playgroud)
和
labels: {
formatter: function() {
if(this.value == '0' ||this.value == '3' ||this.value == '7' ||this.value == '14')
return this.value;
}
},
Run Code Online (Sandbox Code Playgroud)
这种方法有什么问题?任何其他解决方案将不胜感激.
这是一个小提琴,我将继续努力.
最后我解决了这个问题 这是我添加的内容yAxis:
rotation:'auto',
labels: {
distance: 20,
formatter: function() {
if(this.value == '0' ||this.value == '3' ||this.value == '7' ||this.value == '14')
return this.value;
}
},
tickInterval: 1,
minorTickLength:0,
Run Code Online (Sandbox Code Playgroud)
这是小提琴
| 归档时间: |
|
| 查看次数: |
1008 次 |
| 最近记录: |