Svg d34raphael饼图

Svg d34raphael饼图,svg,raphael,d3.js,vml,Svg,Raphael,D3.js,Vml,我需要画一个饼图,它在IE8中起作用,所以我用的是d34raphael 目前这是我的代码,它是从d3饼图示例修改而来的 当我把甜甜圈传递给数据函数时它崩溃了,d3的数据函数中的bind函数有一个group参数。在单步执行数据函数后,我发现group未定义。(对我来说,它在d3.v2.js:4997bind(group=this[i],value.call(group,group.parentNode.\uuuu data\uuuuu,i));上崩溃,它试图在未定义的组上引用parentNode)

我需要画一个饼图,它在IE8中起作用,所以我用的是d34raphael

目前这是我的代码,它是从d3饼图示例修改而来的

当我把甜甜圈传递给数据函数时它崩溃了,d3的数据函数中的bind函数有一个
group
参数。在单步执行数据函数后,我发现
group
未定义。(对我来说,它在d3.v2.js:4997
bind(group=this[i],value.call(group,group.parentNode.\uuuu data\uuuuu,i));
上崩溃,它试图在未定义的
组上引用
parentNode
),我认为这可能与raphael不支持g标记有关。关于如何使用d34raphael的d3饼图布局,有什么想法吗?谢谢

var width = 300,
    height = 300,
outerRadius = Math.min(width, height) / 2,
innerRadius = outerRadius * .6,
data = d3.range(10).map(Math.random),
color = d3.scale.category20(),
donut = d3.layout.pie(),
arc = d3.svg.arc().innerRadius(innerRadius).outerRadius(outerRadius);

// #chart is a div
var paper = new Raphael($('#chart')[0], width, height);
var svg = d3.raphael(paper);

 paper.setStart();

 var vis = svg.selectAll('rect')
.data([data])
.enter().append('rect')
   .attr('x', 0)
   .attr('y', 0)
   .attr('width', width)
   .attr('height', height);

svg.selectAll('path')
    .data(donut)
.enter().append('path')
   .attr('fill', function(d, i) { return color(i); })
   .attr('d', arc)
   .attr('transform', 'translate(' + outerRadius + ',' + outerRadius + ')');

paper.setFinish().transform(['t', 0, 0]);