开发者

How can I add click event to my Raphael pie chart?

开发者 https://www.devze.com 2023-03-06 08:09 出处:网络
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"});

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?


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

精彩评论

暂无评论...
验证码 换一张
取 消