gpt4 book ai didi

Highcharts:如何访问 "columnrange"类型的格式化程序中的范围值?

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

我想自定义 Highcharts 图表的工具提示。 y 轴的类型为“columnrange”,即它具有 y 值的区间:

    series: [{
data: [
[-0.547571175, 0.401498266],
[-0.960011899, 0.444655955],
[-0.660727717, 0.862639688],
[-0.446911722, 0.660380453],
[-0.863925256, 0.619544707],
.......
]
}]

工具提示格式化程序应该看起来像这样:

    tooltip: {
formatter: function() {
var point = this.points[0];
return '<b>'+ point.x +'</b><br />Interval:'+ point.low +' - '+ point.high;
},
shared: true
}

但是 point.lowpoint.high 没有定义...如何获得这些低/高值?

您可以在此处找到示例图:http://jsfiddle.net/dmN3N/21/

最佳答案

如果你在工具提示中使用共享选项,那么你需要使用 this.points[0] 等,如果你禁用了共享选项,你应该使用 this.point

看看分享的例子 http://jsfiddle.net/dmN3N/24/

 tooltip: {
shared:true,
valueSuffix: '',
formatter:function(){

return 'LOW: '+this.points[0].point.low+' HIGH: '+this.points[0].point.high ;
}
},

不共享

http://jsfiddle.net/dmN3N/22/

tooltip: {
valueSuffix: '',
formatter:function(){

return 'LOW: '+this.point.low+' HIGH: '+this.point.high;
}
},

关于Highcharts:如何访问 "columnrange"类型的格式化程序中的范围值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15353673/

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