I have an SVG that outputs strings from an Array...
{"label":"This is an example of my string...", "value":4},
the above is output within an SVG
as...
<text>This is an example of my string...<text>
I want to wrap this over 2 lines however, as so...
This is an example
of my string...
Is this possible?
Markup
arcs.append("text").attr("transform", function(d){
d.innerRadius = 0;
d.outerRadius = r;
d.angle = (d.startAngle + d.endAngle)/2;
return "rotate(" + (d.angle * 180 / Math.PI - 90) + ")translate(" + (d.outerRadius -10) +")";
})
.attr("text-anchor", "end")
.text( function(d, i) {
return data[i].label;
});