gpt4 book ai didi

html - IE8 中可用的 D3 替换(带有 D3 和 svg 的图表)

转载 作者:技术小花猫 更新时间:2023-10-29 12:21:40 27 4
gpt4 key购买 nike

我开发了可用的 D3 驱动图表,就所有其他浏览器而言,没有问题。

但最近出现了在 Internet Explorer 8 中支持它们的需求。

但到目前为止我无法在 IE8 中显示此 html。

这些是 D3 中使用的标签:

<svg> <path> <g> <line> <circle> <rect>

在过去的 6 个小时里,我浏览了很多 Material 和问题,包括:

"Display inline SVG in IE8 "有 this answer从 2012 年 10 月开始:

I have been looking into this too and a number of options came up.

  • Chrome Frame - A browser plug-in that actually uses chrome underneath, meaning SVG just works. This is great if you're able to deploy plugins to the browser, for a real commercial environment however this may not be possible.

  • SVG Web - The aim is it bring SVG to all browsers. It looks like a fairly large project, one that's had Google's input. This doesn't however work out of the box with D3 though I don't know much about the issues.

  • D34Raphael - You've mentioned this one, I found again it doesn't work out of the box. Check the project out on GitHub, there hasn't been any commit activity in months and there's some pull requests "first pass on trying to get support for .on() required for event binding". If it doesn't support events, is that an issue to you? I'd generally keep away from this one.

  • R2D3 - Again another one you mentioned. I took the Sankey example from the D3 website and had to make a few changes to get it working. The main things I couldn't get working (Drag Events, Groups - though can use an alternative). It took about a day of effort to get the example working in IE8 and I believe is in a useable state. The project on GitHub is also much more active, the developer is committing, pulling work in and is very active on discussions etc. This gets my vote.

还有:

D3 IE8 Compatibility?

wikipedia.org/wiki/Scalable_Vector_Graphics

SVG Web Compatibility

但使用客户端插件的解决方案是 Not Acceptable ,目前看来我无法在 IE8 中显示 svg。所以解决办法就是找一些其他的方式来渲染矢量图。我想其他人也有同样的问题


编辑:

无论哪种方式,在我之后遇到同样问题的人至少会有一些集中 Material ,并且会意识到在 IE8 上显示 svg 并没有简单/真正的解决方案,最好花时间从现有的开始非svg版本的代码重写/调整

编辑:

经过一些测试后,我会说尝试通过 R2D3 示例并查看是否有可能在 IE8 中简化/执行代码是值得的

Samples

编辑:

在分别测试不同元素的过程中,似乎出现了一些r2d3问题

最常见的是 Invalid argumentObject doesn't support this property or method

因为我不习惯为 IE8 开发,所以我发现了一些有用的提示:

dump javascript varsdisplay objects

最佳答案

不确定您是否仍在寻找答案,但几年前我在一个项目中遇到过这个问题。我们最终切换到 HighCharts为了浏览器兼容性。当时它作为一个图表库还处于起步阶段,从那时起它变得更加强大并且仍然保持对 IE6 的浏览器支持。

关于html - IE8 中可用的 D3 替换(带有 D3 和 svg 的图表),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21434617/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com