javascript - d3 tree very long text in indented tree how to put it in next line -


hi use jsfiddle reference http://jsfiddle.net/elviz/ge58q/13/

  nodeenter.append("text")   .attr("dy", 3.5)   .attr("dx", 5.5)   .text(function(d) { return d.name; }); 

as can see have node has long text want ask if reach amount of text want excess text in next line.
additional information use foreign object need system run in ie8. unfortunately foreign object not support in ie8 need find way display text properly..........

hy,

i think, can't create next line excess text. however, can use tspan element inside text element like:

<text y="10">     <tspan x="10">tspan line 1</tspan>     <tspan x="10" dy="15">tspan line 2</tspan>     <tspan x="10" dy="15">tspan line 3</tspan> </text> 

see tspan element


Comments