Here's a hack如果你有心開始使用HighCharts。它使用canvg將SVG解析爲畫布,然後將畫布轉換爲PNG。
chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
title: {
text: ''
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}],
navigation: {
buttonOptions: {
align: 'center'
}
}
});
canvg(document.getElementById('canvas'), chart.getSVG())
var canvas = document.getElementById("canvas");
var img = canvas.toDataURL("image/png");
document.write('<img src="'+img+'"/>');
最近版本的高圖使用SVG而不是HTML5畫布呈現:http://www.highcharts.com/component/content/article/2-news/12-highcharts-goes-svg – Mark