From 86c7431e7f8eafc9ea0fc68e9acacdd2809e960b Mon Sep 17 00:00:00 2001 From: oysteinmoseng Date: Mon, 15 Aug 2016 15:51:06 +0200 Subject: [PATCH] Fixed issue #5567, wrong clipping of offline exported SVG in IE11/Edge. --- js/modules/exporting.src.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/modules/exporting.src.js b/js/modules/exporting.src.js index d5113d00d77..dcd1faf41e7 100644 --- a/js/modules/exporting.src.js +++ b/js/modules/exporting.src.js @@ -206,12 +206,13 @@ extend(Chart.prototype, { .replace(/isShadow="[^"]+"/g, '') .replace(/symbolName="[^"]+"/g, '') .replace(/jQuery[0-9]+="[^"]+"/g, '') + .replace(/url\(("|")(\S+)("|")\)/g, 'url($2)') .replace(/url\([^#]+#/g, 'url(#') .replace(/.*?$/, '') + .replace(/<\/svg>.*?$/, '') // Batik doesn't support rgba fills and strokes (#3095) .replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"') /* This fails in IE < 8 @@ -263,7 +264,7 @@ extend(Chart.prototype, { html, options = merge(chart.options, additionalOptions), // copy the options and add extra options allowHTML = options.exporting.allowHTML; - + // IE compatibility hack for generating SVG content that it doesn't really understand if (!doc.createElementNS) { @@ -360,7 +361,7 @@ extend(Chart.prototype, { html = '' + '' + html[1] + - '' + + '' + ''; svg = svg.replace('', html + ''); } @@ -398,7 +399,7 @@ extend(Chart.prototype, { * @param {Object} chartOptions Additional chart options for the SVG representation of the chart */ exportChart: function (options, chartOptions) { - + var svg = this.getSVGForExport(options, chartOptions); // merge the options