gpt4 book ai didi

highcharts - 在仪表 Highcharts 轴标签上显示一些特定数字

转载 作者:行者123 更新时间:2023-12-04 12:52:39 25 4
gpt4 key购买 nike

我想像这样在仪表数据标签上显示一些数字:
gauge with user select number

我尝试在 yAxis 中使用 categoryformatter 选项,但失败了!

categories: ['0','3','7','14'],  

labels: {
formatter: function() {
if(this.value == '0' ||this.value == '3' ||this.value == '7' ||this.value == '14')
return this.value;
}
},

这个方法有什么问题?也将不胜感激任何其他解决方案。
这是一个 fiddle我要继续努力。

最佳答案

最后我解决了这个问题。这是我添加到 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,

这是 Fiddle

关于highcharts - 在仪表 Highcharts 轴标签上显示一些特定数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21092978/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com