javascript D3 IE8 兼容性?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17202118/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 07:28:35  来源:igfitidea点击:

D3 IE8 Compatibility?

javascriptinternet-explorer-8d3.jsvisualization

提问by Lemonio

Is there any way to make D3 compatible with IE8? Many of the posts here and in the documentation suggested using aight. https://github.com/shawnbot/aight/blob/master/aight.js

有没有办法让D3兼容IE8?此处和文档中的许多帖子都建议使用 aight。 https://github.com/shawnbot/aight/blob/master/aight.js

However, I added the lines/file mentioned to my html, but this still doesn't work in ie8. http://matthewpiatetsky.com/jsdemo.html

但是,我将提到的行/文件添加到我的 html 中,但这在 ie8 中仍然不起作用。 http://matthewpiatetsky.com/jsdemo.html

Does anyone know if there are any additional steps I need to take?

有谁知道我是否需要采取任何其他步骤?

Perhaps use r2d3? Not sure how to do that, but will try to figure out

也许使用r2d3?不知道怎么做,但会想办法

回答by ama2

D3 uses SVGs to graph and since IE8 does not support SVG it won't work.I would give R2D3 a try, it shims SVG via Raphael to be compatible with D3. There are some limitations as some functionality won't be available. Look at https://github.com/mhemesath/r2d3/for more details

D3 使用 SVG 来绘制图形,因为 IE8 不支持 SVG,所以它不会工作。我想试试 R2D3,它通过 Raphael 填充 SVG 以与 D3 兼容。由于某些功能将不可用,因此存在一些限制。查看https://github.com/mhemesath/r2d3/了解更多详情

回答by Spartan

aight.js worked for me, just need to take care importing it before d3.js

aight.js 对我来说有效,只需要注意在 d3.js 之前导入它

回答by New Alexandria

Many good demos of R2D3, and Aight demosnow exist.

许多优秀的R2D3的演示,并Aight演示现在存在。

I think that re-coding your question to demo it in one of these libraries is out-of-scope of SE, but hope you find the links useful.

我认为重新编码您的问题以在这些库之一中演示它超出了 SE 的范围,但希望您发现这些链接有用。