score:1

Accepted answer

You need to call donut with your data inside like that :

data2 = data.map(function(d) { return d.value}) // [25, 45]
...
.data(donut(data2))

and then call the label ;

  .text(function(d, i) { return data[i].label; });

See http://jsfiddle.net/980f0cdj/1/


Related Query

More Query from same tag