highchart提供的其他默认事件
click
,也可以在容器上附加事件。如果你是这样的话
mousedown
Attach event to container
$(function () {
$('#container').highcharts({
chart: {
type: 'pie'
},
plotOptions: {
series: {
cursor: 'pointer',
}
},
series: [{
data: [{
y: 29.9
}, {
y: 71.5
}, {
y: 106.4
}]
}]
});
});
$(document).on('mousedown', '#container path', function (e) {
if(e.which==2)
console.log('Middle click on slice '+e.target.point.x+ " value is "+e.target.point.y);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>