$scope.chartObj = new Highcharts.Chart($scope.chartData);
$element.bind('click', function (event) {
// do your code
alert( $scope.chartData.chart.type);
alert('Category: ' + this.category + ', value: ' + this.y);
});
答案 0 :(得分:1)
为什么不按照与data.json类似的方式将click事件添加到图表对象?像这样:
$scope.chartData.plotOptions.series.point.events.click = function (event) {
// do your code
alert( $scope.chartData.chart.type);
alert('Category: ' + this.category + ', value: ' + this.y);
};
请参阅plunker:http://plnkr.co/edit/WA4TcDuoer3ix08T15QM?p=preview