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.

sportsfan72
  • 311
  • 3
  • 8
  • 16

2 Answers2

0

I dont think this can be done with a div. But if you used the canvas element, this is possible:

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

marteljn
  • 6,446
  • 3
  • 30
  • 43
0

From this answer: capture div into image using html2canvas

You might be able to use html2canvas to do the job. I've never used it though so I can't tell you for sure.

Community
  • 1
  • 1
Spina
  • 8,986
  • 7
  • 37
  • 36