D3 line breaks in title element

2

Based on this question in the English forum. I intended to do the same but in my case, there is no type of line break, neither in IE nor in the rest of browsers.

In a first place (before trying the solution to that question), try this solution

ppt.append("svg:title")
.html("<span>AA</span><br/><span>bb</span><br/>")

This solution worked correctly in Chrome and Firefox but in IE I did not add any element.

On my second try I tried this:

titulo = ppt.append("svg:title");
titulo.append("tspan").text("AA");
titulo.append("br");
titulo.append("tspan).text("BB");

But the browsers ignored the line break so I tried with the solution of the aforementioned question. But the author of the answer says this.

  

This version renders as four lines on Chrome 41, Safari 8, Firefox 37 (OSX Yosemite), and IE11 (Windows 7). Unfortunately it still renders as a single line in IE9-10. If you need multi-line display here I'd suggest your own rendering based on mouse events.

What has been going on that will not work for IE9 or IE10, so it does not work for me. After this I have done several tests that have ended up making me think that Internet Explorer is shit a complicated browser to program and I need help from the community to know how I can do it.

Other of my attempts have been to try to add in title elements p , span , other elements title in ... But nothing works

    
asked by Lombarda Arda 12.04.2017 в 09:13
source

1 answer

0

Ie9 the great torture. I think you could try doing it in the first way, by inserting the html. But add a css class to the span and assign it the display: block property. This property makes it behave as a box and does not allow having anything next to it inside its container. Greetings.

    
answered by 12.04.2017 в 15:09