HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 528 forks source link

legend plugin display in IE10 #211

Open i0seph opened 11 years ago

i0seph commented 11 years ago

When a legend is used in other container, the legend can't not be displayed at IE10.

code in js/plugins/legend.js

if(fragments.length > 0){ var table = '

' + fragments.join('') + '
'; if(legend.container){ table = D.node(table); this.legend.markup = table; D.insert(legend.container, table);

}

I resolved to removing a line 'table = D.node(table);' In IE10, when that line make a table object rather than html strings.

check plz, and resolve this problem.

i0seph commented 11 years ago

I found this IE10 bug. in IE10, Flotr.DOM.node () function is not worked unlike expected.

node: function(html) { var div = Flotr.DOM.create('div'), n; div.innerHTML = html; n = div.children[0]; div.innerHTML = ''; return n; } in this function, if div.innerHTML = ''; line will process, n is emptyed. so, I suggest that append cloneNode().

n = div.children[0].cloneNode(true);