简体   繁体   中英

mpld3 interactive legend does not work in IE

I am using the mpld3 library in python and I have notice that on internet explorer the interactive legend plugins does not work.

I've also notice that on the mpld3 web site, the example of interactive legend also does not work in IE.

So i'm kind of stuck here... any help ? you can see on that image that the interactive legend does not work

I'll also put the mpld3 interactive plugins link here: https://mpld3.github.io/examples/interactive_legend.html

Following lines of code in mpld3/plugins.py causing IE incompatibility:

  • line 582 var type = d.mpld3_elements[i].constructor.name
  • line 614 var type = d.mpld3_elements[0].constructor.name

replace them with:

  • var type = d.mpld3_elements[i].constructor.toString().match(/^function\\s*([^\\s(]+)/)[1];
  • var type = d.mpld3_elements[0].constructor.toString().match(/^function\\s*([^\\s(]+)/)[1];

Taken from https://github.com/mpld3/mpld3/issues/191

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM