How to export Nvd3 charts to jpeg or png format

百般思念 提交于 2019-12-10 16:43:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!