0
我提供的buttons
多个Highcharts
,但我需要知道我点击哪个button
...
Example
APIHighcharts渲染器按钮ID
我提供的buttons
多个Highcharts
,但我需要知道我点击哪个button
...
Example
APIHighcharts渲染器按钮ID
内回调this
指点击的按钮。如果您使用attr()
方法,您也可以设置其ID。
var custombutton = charts[i].renderer.button('button', 450, 10, function() {
// not working
alert(this.element.id);
}, null, hoverState, pressedState).attr({
id: 'button-' + i
}).add();
这是一个很好的方式 – R3tep