Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
IE11: Exported PNG/JPG of chart is blank #5410
Exported png/jpg in IE11 contains plot, including images axis labels, when using offline exporting module (we don't have the option of falling back to the export server for the project I'm working on).
Exported png/jpg is blank.
Live demo with steps to reproduce
Download as png or jpg and open exported file. (downloading as SVG works as expected).
According to http://www.highcharts.com/docs/export-module/client-side-export the combination of inline images and IE11 gives a "suboptimal image" which I can confirm.
@oysteinmoseng In this case where the image is utterly useless, should we throw an error or fall back to the export server?
@jon-a-nygaard: Weird, the code for PNG and JPEG should be identical except for a parameter to the canvas converting function. I'm pretty sure IE11 PNG used to work in Windows 7. I'll look into it.
We should probably also provide an example of a hook where the user can do his own browser detection or whatever, and force a fallback.
IE is acting really weird here. As an example: Running Windows 7 and IE11, attempting to export to either PNG or JPEG (without embedded images) will fail on the first try, but subsequent exports are fine. Running Windows 10 with IE11, PNG export always fails, and JPEG always succeeds.
I've tried falling back to various data URIs as well as using XMLSerializer and Base64 objects, but so far no luck. Will continue to investigate.
The gist you linked to, @aaronogan, also mentions potential issues with namespaces in the SVG, but those do not seem to apply to IE11, at least in our case.
It's worth mentioning that Edge (13) always fails, but at least gracefully falls back to the export server.
Found that most of our issues with IE11 are caused by an evasive bug in the browser where the image load handler is sometimes called before the image is actually ready. Deferring the load handler with a small timeout seems to stabilize things.
Also found that Edge has a bug where it capitalizes several SVG attribute names (
Can't promise that I can get all of these browsers to accept embedded images, but at least for normal charts we should have a working fix over the weekend, and graceful fallback to the export server.
added a commit
Jun 27, 2016
IE11 now works for charts without embedded images. Same with Edge, assuming newest version of CanVG is loaded (just load before calling the offline-exporting functions, and the script will use the preloaded canvg).
IE10, IE11 and Edge all fail for embedded images, producing a blank image result. Will look into this further. If tricky, we might resort to just falling back to the export server for these cases.
Note that export to SVG works in all cases.