我想自定义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],
.......
]
}]
Run Code Online (Sandbox Code Playgroud)
工具提示格式化程序应如下所示:
tooltip: {
formatter: function() {
var point = this.points[0];
return '<b>'+ point.x +'</b><br />Interval:'+ point.low +' - '+ point.high;
},
shared: true
}
Run Code Online (Sandbox Code Playgroud)
但是point.low并point.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 ;
}
},
Run Code Online (Sandbox Code Playgroud)
而不是分享
tooltip: {
valueSuffix: '',
formatter:function(){
return 'LOW: '+this.point.low+' HIGH: '+this.point.high;
}
},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8827 次 |
| 最近记录: |