Adding A Line Break To D3 Graph Y-axis Labels
I am trying to add a line break to the y-axis labels on my D3 graph, which displays bandwidth moved. At the moment it displays inline 5 GB, I would like it to display like so, 5 GB
Solution 1:
The problem is that you're adding the tspan
elements as text without a namespace. This way they get interpreted as HTML. If you add them using D3 or explicitly create the elements with a namespace, it should work, i.e.
el.text('');
d3.select(el).append("tspan").text(sections[0]);
...
Post a Comment for "Adding A Line Break To D3 Graph Y-axis Labels"