I have multiple pie charts which I put them in an 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 I am adding click event to each pie chart :
$.each(pie_array, function(i, p){
$(p).click(function(){
alert(p);
});
});
But unable to fire an event when I click pie chart...any solutions?
Possible duplicates: How to add jquery click event to gRaphael graphics?
and
how can i add click evet to my rapahel pie chart?
but none of the solutions work
I even used:
//below one says click event on unknown element..I printed p and it raphael set
$.each(pie_array, function(i, p){
p.click(function(){
alert(p);
});
});
and
$.each(pie_array, function(i, p){
p.node.oclick = function(){
alert(p);
};
});
but no progress