1

I have generated four charts on the html page using amchart in 4 divs respectively. On each div there is a link for export the chart. The charts are generated using multiple SVG. I want to save the chart separately as an image on client side by clicking the export link.

Finally, I got my solution. I convert all the svg to image one by one and write it in a div using http://www.battlehorse.net/page/topics/charts/save_google_charts_as_image.html

And finally I convert the div content to image using http://html2canvas.hertzen.com/index.html. If any one want to convert the text and svg then you need to clone the div content to the new div and then write the converted image to new div and finally convert it to image.

3
  • possible duplicate of Convert a div and contents inside it to image < might be > :) i will not down vote you but please improve your question quality consider it a constructive comment bruv!! :)) Commented Jul 31, 2012 at 10:40
  • I try to find the solution but not found that links, any any better solution Commented Jul 31, 2012 at 10:48
  • have you got any solution on it? and links are not working Commented Sep 11, 2018 at 6:38

1 Answer 1

1

If you could draw the chart on a canvas you could save that. Just saving a div and it's contents to an image is hard (I don't think it's even possible)...

Your question is related to this. It might help.

EDIT

If you are using amchart, it is creating an svg. You can create an hidden canvas, draw the svg onto the canvas, save it as a data url, present it as a jpg/png/.. to the users. (more info)

Sign up to request clarification or add additional context in comments.

4 Comments

the chart have draw using amchart in a div element. i need to save this as an image
so it's an SVG? you can save that too! stackoverflow.com/questions/5433806/… It's a good idea to update your question, give us more info about this specific problem.
Thanks for you suggestion. I'm trying.
Now, i can convert one svg to image. I follows battlehorse.net/attach/topics/charts/…, gist.github.com/1333906. But i need to convert the div content into image that contains multiple svg.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.