Skip to content

Instantly share code, notes, and snippets.

@mbroadst
Last active August 29, 2015 14:16
Show Gist options
  • Save mbroadst/af5588d030868bb9631e to your computer and use it in GitHub Desktop.
Save mbroadst/af5588d030868bb9631e to your computer and use it in GitHub Desktop.
var label_group = d3.select(selector + ' .label_group');
label_group.selectAll("text").remove();
label_group.selectAll("text")
.data(pie(Object.keys(data.status)))
.enter().append("svg:text")
.attr("dy", "1em")
.attr("dx", "0.5em")
.style("fill", "white")
.style("font", "bold 1.10em Arial")
.style("kerning", "1")
.style("letter-spacing", "2");
var label_text = label_group.append("textPath")
.attr("xlink:href", function(d, i) { return "#path" + i; });
label_text.append("svg:tspan")
.text(function(d) { return d.data; });
label_text.append("svg:tspan")
.text(function(d) { return "testing"; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment