I didn't do a thorough pass through the script, but if you change the 
getImgData function to something like the below (look for the parent of the 
svg element under your chartContainer, rather than under an iframe) then it 
seems to work...

http://jsfiddle.net/SCjm8/1/

      function getImgData(chartContainer) {
        var chartArea = chartContainer.getElementsByTagName('svg')[0].
parentNode;
        var svg = chartArea.innerHTML;
        var doc = chartContainer.ownerDocument;
        var canvas = doc.createElement('canvas');
        canvas.setAttribute('width', chartArea.offsetWidth);
        canvas.setAttribute('height', chartArea.offsetHeight);
        
        canvas.setAttribute(
            'style',
            'position: absolute; ' +
            'top: ' + (-chartArea.offsetHeight * 2) + 'px;' +
            'left: ' + (-chartArea.offsetWidth * 2) + 'px;');
        doc.body.appendChild(canvas);
        canvg(canvas, svg);
        var imgData = canvas.toDataURL('image/png');
        canvas.parentNode.removeChild(canvas);
        return imgData;
      }

On Tuesday, October 2, 2012 11:00:41 AM UTC-4, asgallant wrote:
>
> Yes.  The newest release of the charts does not use iframes to draw the 
> charts in all browsers except IE < 9 (which aren't relevant here anyway, 
> since this image conversion script only supports SVG charts, which IE < 9 
> does not use).  I think there have been some other changes in the 
> background that also affect the script, but I'll have to investigate 
> further.
>
> On Tuesday, October 2, 2012 10:31:23 AM UTC-4, Patrike wrote:
>>
>> Hi : )
>>
>> Does the new version has something to do with the no-work with the code 
>> bellow?
>>
>> https://gist.github.com/1333906
>>
>> Thanks
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/yt7e6JIGwu0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to