检索raphael饼图的属性

如何获取raphael饼图的属性:

属性如:笔划,值(不带图例),半径,x和y位置

我的饼图定义为:

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

我试过了:

this.stroke – 说未定义

//我知道这对我来说是正确的raphael对象,因为我也做了一些工作

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

this.attr( ‘行程’); – 甚至不显示未定义

任何想法如何解决这个…谢谢

你可以像这样从馅饼切片中获取它

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

或者像馅饼本身一样

 console.log(pie.series[0].attrs.stroke);