Highcharts.getSVG = function (charts) { var svgArr = [], top = 0, width = 0; $.each(charts, function (i, chart) { var svg = chart.getSVG(); svg = svg.replace('', ''); //svg = svg.replace('', '');(这段注释的代码用来生成多个图片) top += chart.chartHeight; width = Math.max(width, chart.chartWidth); svgArr.push(svg); }); return '' + svgArr.join('') + ''; }; Highcharts.exportCharts = function (charts, options) { var form svg = Highcharts.getSVG(charts); // 合并选项 options = Highcharts.merge(Highcharts.getOptions().exporting, options); // 新建form form = Highcharts.createElement('form', { method: 'post', action: options.url }, { display: 'none' }, document.body); // 添加参数 Highcharts.each(['filename', 'type', 'width', 'svg', 'DTime'], function (name) { Highcharts.createElement('input', { type: 'hidden', name: name, value: { filename: options.filename || 'chart', type: options.type, width: options.width, svg: svg, DTime: options.DTime //(此参数为自定义参数) }[name] }, null, form); }); //console.log(svg); return; // submit form.submit(); //清除 form.parentNode.removeChild(form); };