score:2

Accepted answer

Update the way you are calculating total length:

var totalLength = [path[0][0].getTotalLength()];

you should do

var totalLength = d3.max(path[0], function(d1){return d1.getTotalLength()});

So that you can set the maximum length to the stroke-dashoffset

working code here


Related Query

More Query from same tag