0
我正在使用Pie Highchart,我想在点击事件中调用一个函数。我不想写如下的函数逻辑。这里可以调用一个外部函数吗?如何在Highcharts中添加点击事件功能
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true,
point:{
events:{
click: function(oEvent){
alert(oEvent.point.name);
}
}
}
}
},
这个回调函数将有很多行代码,所以我想在其他地方定义它,并调用它的plotoptions。让我知道,该如何实现呢
是啊,简单地定义一个函数:'功能myFun(){}'然后再使用它:'点击: myFun'。 –