how can i add click evet to my rapahel pie chart?

旧时模样 提交于 2019-12-12 04:15:47

问题


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"});

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 onclcik function ??


回答1:


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 */ };


来源:https://stackoverflow.com/questions/6013801/how-can-i-add-click-evet-to-my-rapahel-pie-chart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!