实例在,但是要加入
style: {
pointerEvents: 'all'
}
http://jsfiddle.net/quvaepad/3/
$(function () {
$('#container').highcharts({
tooltip: {
followPointer:false,
useHTML: true,
backgroundColor: "#dddddd",
formatter: function () {
return 'Please <a href="www.baidu.com" class="comment_triger">Comment</a> On <b>' + this.x +
'</b> = <b>' + this.y + '</b>';
},
style: {
pointerEvents: 'all'
}
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4]
}]
});
$(document).on('click', '.comment_triger', function(e) {
e.preventDefault();
alert("Yahooooooooooo");
})
});
要添加的js事件委托!https://stackoverflow.com/questions/31669246/click-event-not-fire-in-highcharts-tooltip