0

I have the following SVG element were i have a text on the graph.

   wrapper.append("text")
          .text(data[i].name)
          .attr("x", 10)
          .attr("y", 30)
          .attr("class", "text-class")

I want to apply word-break: break-word; to the text so that it falls to the second line when the characters are more and doesn't overflow the chart. i tried styling the class text-class also tried inline styling like .attr("word-break", 'break-word'). but it doesn't seems to be working. can someone tell me how can i achieve this.

Sha
  • 1,826
  • 5
  • 29
  • 53

1 Answers1

-1

inline styling usually looks like

.attr('style', 'word-break: break-word;')