View Full Version : How to get the SVG data for a chart?

1 Aug 2012, 10:57 PM

I am using below code to get the SVG data/html for the chart rendered and pass using a post AJAX request to batik transcoder module, which gives me the JPG for the chart:

var SvgData = Ext.DomQuery.selectNode('svg', 'chartContainer').parentNode.innerHTML;

This works well in Firefox, Chrome and Safari, however breaks in IE. Getting "Ext.DomQuery.selectNode('svg', 'chartContainer').parentNode.innerHTML null or not an object"error...

Can anyone please help me here?


2 Aug 2012, 12:51 AM

I was just tried using below code to get the SVG data in IE.

var SvgData = document.getElementById("myChart").innerHTML;

However, I see that IE doesnt have SVG as innerHTML. Rather, instead it uses rvml tags ...

I think in thats case batik transcoder will not work. Any other workaround here? Can I convert rvml to SVG or, can I force only SVG Charts in IE? ...

Please advise.

23 Aug 2012, 4:35 AM
After doing some research, I found that, Mcrosoft started supporting SVG IE9 onwards, lower versions uses VML/RVML.

So, downloading a new IE version is the only workaround if you have to work with SVG.