Can't display SVG charts in Internet Explorer 8

后端 未结 2 800
独厮守ぢ
独厮守ぢ 2020-12-11 06:51

I made a servlet that runs and renders a BIRT report, using ReportEngine API.

The only problem is that SVG images (charts) are not shown in Internet

相关标签:
2条回答
  • 2020-12-11 07:25

    You may consider using Ample SDK JavaScript library that can render SVG in IE6, 7 and 8.

    0 讨论(0)
  • 2020-12-11 07:35

    The X-UA-Compatible meta tag that you've spotted is a red herring; it's not related to SVG. Neither IE8 or IE7 support SVG at all. Support for SVG was only added in IE9.

    The meta tag you've seen tells IE8 (and IE9 for that matter) to fall back into IE7-compatibility mode. This is intended to be used by sites that were written for IE7, where updating the code to support IE8 or IE9 is too much work. I'd recommend avoiding using this meta tag if at all possible, because it's primary function is to switch off some of the functionality of your browser.

    Back to SVG support.... While they don't support SVG, IE7 and IE8 do both support VML, which is also a vector graphics markup language, similar to SVG, but specific to IE.

    Some Javascript libraries attempt to emulate SVG using VML, or to use VML as a fall-back instead of rendering SVG. My favourite is Raphael.

    But Raphael is a library for drawing the graphics; since you already have the SVG, you may find a simple conversion library is more useful. Something like this, perhaps: http://code.google.com/p/svg2vml/ or this: http://code.google.com/p/svgweb/

    The other approach would be to use Flash or other embedded object to render the SVG in IE.

    My guess is that where you're seeing them successfully rendering SVG, they are using one of these libraries (or another similar one) to display the SVG graphics in IE7 and IE8.

    0 讨论(0)
提交回复
热议问题