我使用D3 Javascript库生成了图表,并需要将其保存为PNG或SVG文件。是否有一些能够完成此任务的库?
我找到了这个https://github.com/sampumon/SVG.toDataURL,但在我的HTML5中它无法工作,在Firefox控制台中出现以下错误:
NS_ERROR_NOT_AVAILABLE: Component is not available [Interrompi per questo errore]
ctx.drawImage(img, 0, 0);
我找到了这个https://github.com/sampumon/SVG.toDataURL,但在我的HTML5中它无法工作,在Firefox控制台中出现以下错误:
NS_ERROR_NOT_AVAILABLE: Component is not available [Interrompi per questo errore]
ctx.drawImage(img, 0, 0);
d3.select('svg').attr("xmlns", "http://www.w3.org/2000/svg");
- methodofaction