这里有一个示例https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-point-events-click/,当单击系列上的标记时发出警报。
当图表上的任何x,y点被单击时,是否有方法发出警报?
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
alert('Category: ' + this.category + ', value: ' + this.y);
}
}
}
}
},
1条答案
按热度按时间enyaitl31#
您需要图表对象中的click事件。https://api.highcharts.com/highcharts/chart.events.click
https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/chart/events-click/