问题
Is there any better or easy way to export nvD3 chart to jpeg or png image format? I tried Javascript SVG parser and renderer on Canvas by using http://code.google.com/p/canvg/ But in some cases (may be due to large size or greater resolution) the export option not working.
回答1:
In case you want to support all browsers including IE/safari you'll have to implement that server side. I tried a lot but couldn't find a foolproof way to achieve 100% browser compatibility using only js. Canvg and saveSvgAsPng won't help you beyond firefox/chrome.
See how highcharts doing that as a fallback option http://www.highcharts.com/docs/export-module/setting-up-the-server
来源:https://stackoverflow.com/questions/21043376/how-to-export-nvd3-charts-to-jpeg-or-png-format