I've created a chart using D3.js here (http://jsfiddle.net/jkuchta/u57mt97c/) but I'm running into issues with the labels. How could I add a legend to this or have the labels only appear on hover?
// DRAW SLICE LABELS
var sliceLabel = label_group.selectAll("text")
.data(donut(data.pct));
sliceLabel.enter().append("svg:text")
.attr("class", "arcLabel")
.attr("transform", function(d) {return "translate(" + arc.centroid(d) + ")"; })
.attr("text-anchor", "middle")
.text(function(d, i) {return labels[i]; });
I ended up creating charts using the below. Fiddle (https://jsfiddle.net/dp50bLmo/)