Here is the code:
http://jsfiddle.net/fJAwW/
This is what I am interested in:
path
.attr("stroke-dasharray", totalLength + " " + totalLength)
.attr("stroke-dashoffset", totalLength)
.transition()
.duration(2000)
.ease("linear")
.attr("stroke-dashoffset", 0);
I have my data variable lineData, which I add to the path with
.attr("d", line(lineData))
For the transition section:
.transition()
.duration(2000)
I would like to do something like
.transition()
.duration(function(d) {
return d.x;
})
Where d is one of my data points.
I am having trouble understanding the data structures and how they interact in d3.js, so any help would be appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…