如何在我的rapahel饼图中添加Click evet? [英] how can i add click evet to my rapahel pie chart?
本文介绍了如何在我的rapahel饼图中添加Click evet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在我的 Rapahel 饼图中添加点击事件?
How can I add click event to my Rapahel pie chart ?
var r = Raphael("holder-1",340, 185);
pie = r.g.piechart(150,85, 75, values , {legend: labels, legendpos: "east"});
我得到的答案是pie.click(function(){});
i got the answer it is pie.click(function () { });
我可以将值传递给onclick事件吗?这里我可以将值和标签传递给onclcik函数吗?
can i pass value to the onclick event ?, here can i pass values and labels to onclcik function ??
推荐答案
根据节点属性的文档,您应该只是能够像使用它的任何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:
pie.node.onclick = function () { /* Something */ };
这篇关于如何在我的rapahel饼图中添加Click evet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文