2017-05-03 48 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