This is the code that generates the text tag in svg from using the D3 library:
nodeEnter.append("text")
.attr("x", rectW / 2)
.attr("y", rectH/3)
.attr("dy", ".35em")
.attr("text-anchor", "middle")
.text(function (d) {
return d.nome + "\n"+ d.tipo;
});
I found a way that would be re-creating another text tag, with different height, type:
nodeEnter.append("text")
.attr("x", rectW / 2)
.attr("y", rectH/3)
.attr("dy", ".35em")
.attr("text-anchor", "start")
.text(function (d) {
return d.nome ;
});
nodeEnter.append("text")
.attr("x", rectW / 2)
.attr("y", rectH/2)
.attr("dy", ".35em")
.attr("text-anchor", "start")
.text(function (d) {
return d.tipo;
});
Then it's the way I want it, like this:
ButIwantedtoknowifthereisanywaytomakethisbreakinappend
Iwanttobreakthelinetogetthenameandtypeoneunderneaththeother: