如何避免Highcharts中的工具提示覆盖整个栏?我正在尝试使用向下钻取功能创建条形图,但下面示例中的"John"栏我总是被工具提示本身所覆盖,这使得向下钻取非常困难.
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Column chart with negative values'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
credits: {
enabled: false
},
plotOptions: {
series: {
cursor: 'pointer'
}
},
series: [{
name: 'John',
data: [-1, -1, -1, -1, 2]
}, {
name: 'Jane',
data: [2, -2, -3, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, -2, 5]
}]
});
});
Run Code Online (Sandbox Code Playgroud)
如果您有兴趣,可以通过几种方式完成.
使用,修复工具提示的位置tooltip positioner.
tooltip: {
positioner: function () {
return { x: 80, y: 50 };
}
Run Code Online (Sandbox Code Playgroud)
一个工作的例子是here.
使用跟随指针选项.您可以避免遇到的问题并允许工具提示仍处于浮动状态.
tooltip:{
followPointer:true
},
Run Code Online (Sandbox Code Playgroud)
另一个工作的例子是here.
| 归档时间: |
|
| 查看次数: |
2380 次 |
| 最近记录: |