简体   繁体   English

Highcharts渲染器按钮ID

[英]Highcharts Renderer Button ID

I've rendered the buttons to multiple Highcharts , but I need to know which button I click.. 我已经将buttons渲染到多个Highcharts ,但我需要知道我点击了哪个button ..

Example

API API

Inside a callback this refers to the clicked button. 在回调内部, this是指单击的按钮。 You can also set its id if you use attr() method. 如果使用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();

example: http://jsfiddle.net/kh5jY/9517/ 示例: http//jsfiddle.net/kh5jY/9517/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM