0

How to get the attributes of raphael pie chart:

attributes like: stroke, values (not with legend), radius, x and y position

My pie chart is defined as:

pie = r.piechart(120, 140, 50, [55, 22], {
    colors: ["green","red"],
    stroke: "black"   
});

I tried:

this.stroke -- says undefined

// I know this is getting me the raphael object correctly since I am doing some work also

this.click(function () { 
   alert(this.stroke); 
});

this.attr('stroke'); -- does not even display undefined

Any idea how to solve this...thanks

4

1 回答 1

1

你可以像这样从馅饼片本身得到它

console.log(this.prev.prev.prev.attrs.stroke); //I know it looks a bit ugly...

或者像这样从馅饼本身

console.log(pie.series[0].attrs.stroke);
于 2013-04-07T07:00:40.577 回答