File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ modeBarButtons.toImage = {
49
49
title : 'Download plot as a png' ,
50
50
icon : Icons . camera ,
51
51
click : function ( gd ) {
52
+ var format = 'png' ;
53
+
52
54
Lib . notifier ( 'Taking snapshot - this may take a few seconds' , 'long' ) ;
53
55
54
- downloadImage ( gd )
56
+ if ( Lib . isIE ( ) ) {
57
+ Lib . notifier ( 'IE only supports svg. Changing format to svg.' , 'long' ) ;
58
+ format = 'svg' ;
59
+ }
60
+
61
+ downloadImage ( gd , { 'format' :format } )
55
62
. then ( function ( filename ) {
56
63
Lib . notifier ( 'Snapshot succeeded - ' + filename , 'long' ) ;
57
64
} )
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ function downloadImage(gd, opts) {
40
40
// does not allow toDataURL
41
41
// svg format will work though
42
42
if ( Lib . isIE ( ) && opts . format !== 'svg' ) {
43
- reject ( new Error ( 'Sorry IE does not support downloading from canvas.' ) ) ;
43
+ reject ( new Error ( 'Sorry IE does not support downloading from canvas. Try {format:"svg"} instead. ' ) ) ;
44
44
}
45
45
46
46
gd . _snapshotInProgress = true ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function svgToImg(opts) {
35
35
// Leave here just in case the CORS/tainted IE issue gets resolved
36
36
if ( Lib . isIE ( ) ) {
37
37
// replace double quote with single quote
38
- svg = svg . replace ( / " / gi, "'" ) ;
38
+ svg = svg . replace ( / " / gi, '\'' ) ;
39
39
// url in svg are single quoted
40
40
// since we changed double to single
41
41
// we'll need to change these to double-quoted
You can’t perform that action at this time.
0 commit comments