6

I use RaphaelJS for generate SVG. My SVG is 1024px width and height. I use setViewBox because the div containing it is more small than 510px width and height.

With IE8 RaphaelJS produces VML but setViewBox is not working, the size of VML produced is 1024px.

How I can make that VML responsive?

paper = Raphael(document.getElementById("SVGDiv"));

paper.canvas.id = 'paper';
paper.setViewBox(0,0,1024,1024);
paper.setViewBox(0,0,1024,1024);
image = paper.image("",0,0, 1024, 1024);
text = paper.text(512, 512, '');
if( isIE() > 8 || isIE() == false){
    paper.setSize("100%","100%");
}
Ruslan López
  • 4,433
  • 2
  • 26
  • 37
S8N
  • 147
  • 7
  • Your question title does not really hint to a problem, please change the title to a more descriptive line for your problem. – Joop Apr 24 '15 at 08:46
  • Did you ever find a solution to this? It seems like there are some bugs in the recent versions of Raphael in the VML module, see for example [Raphael.js function getBBox give back NAN/NAN/NAN in IE8](http://stackoverflow.com/questions/33277052/raphael-js-function-getbbox-give-back-nan-nan-nan-in-ie8/39329259#39329259) which is tracable to some wonky code related to VML viewboxes. For me in 2.2.0 and 2.2.1 setViewBox doesn't zoom and the VML element event when set with % widths doesn't scale responsively – user56reinstatemonica8 Sep 05 '16 at 15:15
  • I use more VML so I have no solution Sry – S8N Feb 17 '17 at 08:00

0 Answers0