2017-05-03 41 views
0

我想在工具提示中添加一个链接。问题是,如果我切换到手机,并点击工具提示,就像我点击它。它不会将我发送到其他页面,只会在单击时移动工具提示。Highcharts - 饼图 - 工具提示中的链接

chart: { 
     type:'pie' 
}, 

title: { 
    text: 'Full HTML tooltip with border, background and shadow' 
}, 

tooltip: { 
    useHTML: true, 
    style: { 
    padding: 0, 
    pointerEvents: 'auto' 
    }, 
    formatter: function() { 
    return '<a href="http://google.com"> click here </a>' 
    } 
}, 

有没有人有任何技巧来实际触发我点击的链接?

这里的fiddlle http://jsfiddle.net/zfwx6s9q/1/

感谢。

+0

可你能够点击链接,里面提示。看到这[回答](http://stackoverflow.com/a/24488098/3898339)它可能有帮助 –

+0

我需要在工具提示上的链接,而不是在切片上。 – Andy

+0

将'tooltip.followPointer'设置为false,演示:http://jsfiddle.net/zfwx6s9q/3/(使用Android进行测试) –

回答

0

您可以尝试改变工具提示的显示方式。

tooltip: { 
     useHTML: true, 
     positioner:function(){ return {x:100, y:100}; }, 
     hideDelay:3000, 
     style: { 
     padding: 0, 
     pointerEvents: 'auto' 
     }, 
     formatter: function() { 
     return '<a href="http://google.com"> click here </a>' 
     } 
    }, 
  • 设置提示现在的位置是固定的
  • 增加隐藏延迟

http://jsfiddle.net/zfwx6s9q/2/

+0

感谢您的评论,不幸的是我需要显示它被点击的地方。 – Andy