javascript - Click event on raphael pie chart -
i have multiple pie charts put them in array:
var pie_array = new array();
creating pie charts like:
for loop{ pie = r.piechart(48+i*120,40,30,[100], { colors: ["white"], maxslices: 1 }); }
now adding click event each pie chart :
$.each(pie_array, function(i, p){ $(p).click(function(){ alert(p); }); });
but unable fire event when click pie chart...any solutions?
possible duplicates: how add jquery click event graphael graphics?
and
how can add click evet rapahel pie chart?
but none of solutions work
i used:
//below 1 says click event on unknown element..i printed p , raphael set $.each(pie_array, function(i, p){ p.click(function(){ alert(p); }); }); , $.each(pie_array, function(i, p){ p.node.oclick = function(){ alert(p); }; });
but no progress
it looks not adding created pie charts array.
Comments
Post a Comment