Anand
Anand

Reputation: 245

D3.JS ForeignObject not rendering in IE and Firefox

As per the guidance I have read, in order to add any html elements in D3.JS SVG we need to create ForeignObjects. So I added a tag using foreign object and its working just fine in Chrome. Below is the code I am using.

this.g.append('svg:foreignObject')
.attr('font-size', "15px")
.attr('x', x - 10)
.attr('y', y - 55)
.append("xhtml:div")
.html('<div class="terst">some text</div></div>')

My problem is, it is not rendered in IE and Firefox. Could you please let me know if I miss anything obvious.

Upvotes: 2

Views: 1856

Answers (2)

Anand
Anand

Reputation: 245

After a bit of investigation, have realized ForeignObject is not supported or having issues with IE and Firefox. So decided to change my implementation so it can be supported by all browsers.

Upvotes: -2

Robert Longson
Robert Longson

Reputation: 124179

Upvotes: 3

Related Questions