Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes in SaveChartAsImage.js
use devicePixelRatio / backingStorePixelRatio for correct image scaling on Retina devices
use file-saver for correct image saving on IE/Edge/Safari
add canvg parameter for fallback when saving in IE11/Edge (IE has security bug when trying to save canvas with any svg image painted on).
See https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/1015651/ or similar bugreports.
See description for canvg parameter here: https://github.com/exupero/saveSvgAsPng (canvg - If canvg is passed in, it will be used to write svg to canvas. This will allow support for Internet Explorer)
Add paddings parameter to save functions
Add save-svg-as-png workaround to fix bug with saving on IE11: we want width/height from svg, because Image.width/height returns 0 in IE11.
Maybe, this bug exits only when we set image.src to svg as dataurl...
Anyway, this bug exists, and we need some workaround for it.
Use file-saver https://github.com/eligrey/FileSaver.js to have correct cross-platform image saving (solution with tag does not work on IE11/Edge, and Safari).
Add polyfills to documentation pages (for IE11 compatibility): @babel/polyfill, blueimp-canvas-to-blob, and canvg.
Also, use saveChartAsImageWithOptions method to send canvg parameter for IE11/Edge compatibility