0

I have below code which parses myObj.label as a svg <text> tag.

myObj.label = data.plan + ' ' + data.Actual;

I would like to insert a line break in between actual and plan data. I tried below code but it does not work.

myObj.label = data.plan + ' <tspan dy="1em"> </tspan> ' + data.Actual;

Instead of getting a line break it just prints when the html is created. I want to create a <tspan> tag in the text.

A solution is much appreciated.

Mustafa
  • 202
  • 3
  • 14
  • You haven't provided enough info. What is `myObj`? Help us to help you. Please include an [MCVE](http://stackoverflow.com/help/mcve). – Paul LeBeau Nov 09 '16 at 11:51
  • Possible duplicate of [How to linebreak an svg text within javascript?](http://stackoverflow.com/questions/16701522/how-to-linebreak-an-svg-text-within-javascript) – Andrew Willems Nov 10 '16 at 04:02
  • actually `myObject` is a third party object which internally parses `label` in svg ``. – Mustafa Nov 10 '16 at 08:37

0 Answers0