我的图表是:
http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/3d-scatter-draggable/
我知道,如果我想在高级图表中禁用工具提示效果,我需要在代码中添加以下内容:
tooltip: {
enabled: false
}但我不知道怎么才能让它失效。
series: [{
name: 'Reading',
colorByPoint:
{ color: "#ff0000"},
data: [
// [X, Y, Z]
[1, 8, 1],
[1, 9, 2],
[1, 1, 5],
[2, 7, 2],
[2, 3, 4],
[4, 5, 7],
[4, 5, 8],
[7, 3, 3],
[7, 8, 5],
[10, 7, 10]
]},{ ------ draw a line on bottom frame
data: [[0,0,5],[10,0,5]
],
lineWidth: 1,
marker: {
enabled: false
},
color: 'rgba(0,0,0,0.51)'
}, ------ end draw
{ // ------ draw a point on (right edge) bottom frame
data: [[10.7,0,5]],
dataLabels: {
enabled: true,
crop: false,
overflow: false,
format: 3,
},
marker: {
enabled: false,
states:{
hover: {
enabled: false
}
}
}
}]如何禁用我添加的点的工具提示?
发布于 2015-02-14 13:49:21
可以使用tooltip.formatter禁用特定点的工具提示。您需要向没有工具提示的点添加一些标识属性,然后在tooltip.formatter函数中检查这些属性。
例如,您可以这样设置您的data (参见第一点):
data: [{x:1, y:6, z:5, noTooltip: true}, [8, 7, 9], [1, 3, 4], [4, 6, 8], [5, 7, 7]]然后,在您的tooltip.formatter中,您可以这样评估:
tooltip: {
formatter: function() {
// If the point is going to have a tooltip
if(!this.point.noTooltip) {
// Mimic default tooltip contents
return '● '+this.series.name+
'<br/>x: <b>'+this.point.x+
'</b><br/>y: <b>'+this.point.y+
'</b><br/>z: <b>'+this.point.z+
'</b><br/>';
}
// If tooltip is disabled
return false;
}
}请参见本JSFiddle演示 (禁用点位于左下角的坐标1,1,0处)。
https://stackoverflow.com/questions/28514555
复制相似问题