日期:2014-05-18 浏览次数:20711 次
// Extend AmCharts object
AmCharts.getExport = function(id) {
var wrapper = document.getElementById(id);
var svgs = wrapper.getElementsByTagName('svg');
var options = {
ignoreAnimation : true,
ignoreMouse : true,
ignoreClear : true,
ignoreDimensions: true,
offsetX : 0,
offsetY : 0
};
var canvas = document.createElement('canvas');
var context = canvas.getContext('2d');
var counter = {
height : 0,
width : 0
}
// Nasty workaround until somebody figured out to support images
function removeImages(svg) {
var startStr = '<image';
var stopStr = '</image>';
var stopStrAlt = '/>';
var start = svg.indexOf(startStr);
var match = '';
// Recursion
if ( start != -1 ) {
var stop = svg.slice(start,start+1000).indexOf(stopStr);