I am working with an SVG that displays strings pulled from an Array...
{"label":"Here is an example of the string...", "value":4},
The text above is shown in an SVG
element as...
<text>Here is an example of the string...<text>
I would like to split this text over 2 lines, like this...
Here is an example
of the string...
Is there a way to achieve this?
Code Snippet
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;
});