d3.js的弧过渡问题

时间:2016-08-14 14:09:47

标签: d3.js

// last line doesn't work 
var gaugeNiddle = d3.svg.arc()
    .startAngle(gaugeCircleX(0))
    .endAngle(gaugeCircleX(1))
    .outerRadius(gaugeCircleY(config.radius))
    .innerRadius(gaugeCircleY(0.3*config.radius));
gaugeGroup.append("path")
    .attr("d", gaugeNiddle)
    .style("fill", "001010")
    .attr('transform','translate('+config.radius+','+config.radius+')');    

// here is stop working
gaugeNiddle.transition().duration(1000).attr('innerRadius',250);

1 个答案:

答案 0 :(得分:-1)

知道了。应该是:

var gaugeNiddle = gaugeGroup.append("path")
    .attr("d", gaugeNiddle)
    .style("fill", "001010")
    .attr('transform','translate('+config.radius+','+config.radius+')');