I want to pull up the firstname & lastname from json database & it should be shown in two lines.....
What needs to be changed in the below code ?
.text(function(d) { return d.firstname +"<br/>"+ d.lastname;});
I want to pull up the firstname & lastname from json database & it should be shown in two lines.....
What needs to be changed in the below code ?
.text(function(d) { return d.firstname +"<br/>"+ d.lastname;});
I think you cannot directly add an html element directly.
You can use foreignObject.
svg.append("foreignObject")
.attr("width", "50px")
.attr("height", "50px")
.append("xhtml:div")
.html(function(d) {
return (d.firstname + " <br> " + " " + d.lastname);
});