mpld3交互式图例在IE中不起作用

2024-04-29 11:16:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是python中的mpld3库,我注意到internetexplorer上的交互式图例插件不起作用。你知道吗

我还注意到,在mpld3网站上,交互式图例的示例在IE中也不起作用

所以我被困在这里。。。有什么帮助吗?you can see on that image that the interactive legend does not work

我还将把mpld3交互式插件链接放在这里:https://mpld3.github.io/examples/interactive_legend.html


Tags: image插件you示例that网站oncan
1条回答
网友
1楼 · 发布于 2024-04-29 11:16:06

mpld3中的以下代码行/插件.py导致IE不兼容:

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

替换为:

  • 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];

取自https://github.com/mpld3/mpld3/issues/191

相关问题 更多 >