如何将点击事件添加到我的 Raphael 饼图?
如何将点击事件添加到我的 Raphael 饼图?
var r = Raphael("holder-1",340, 185);
pie = r.g.piechart(150,85, 75, values , {legend: labels, legendpos: "east"});
我得到的答案是:
pie.click(function () { });
我可以将值传递给onclick
事件吗?我可以在这里将值和标签传递给
onclick` 函数吗?
How can I add click event to my Raphael pie chart ?
var r = Raphael("holder-1",340, 185);
pie = r.g.piechart(150,85, 75, values , {legend: labels, legendpos: "east"});
I got the answer it is:
pie.click(function () { });
Can I pass value to the onclick
event? Here can I pass values and labels to
onclick` function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 node 属性 的文档,您应该能够像任何其他事件一样附加事件使用它的 DOM 元素:
According to the docs for the node attribute, you should just be able to attach events as you would any DOM element using it: