0

I currently have a div tag that contains a bunch of other within it, and together they represent a line-graph. What I want to do is export this line-graph to an image(.png, .jpeg, etc) so that the user can download it. How can I do this?

It's a JSP web page, using JavaScript, jQuery and the back-end is handled by Java.

4

2 回答 2

0

从这个答案:使用 html2canvas 将 div 捕获到图像中

您也许可以使用 html2canvas 来完成这项工作。我从来没有使用过它,所以我不能肯定地告诉你。

于 2014-06-17T18:13:14.947 回答
0

我不认为这可以用div. 但是如果你使用了这个canvas元素,这是可能的:

http://davidwalsh.name/convert-canvas-image

于 2013-10-17T00:22:18.633 回答