Possible Duplicate:
How to save a jQuery FLOT Graph to a .png or orther image formate?
Is it possible to save graphs build with flot as images?
If yes, how?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When working with HTML5-capable browsers, flot outputs graphs to a <canvas> element. The canvas element has a fairly widely-supported ToDataURL() method that you can use to write the canvas to a URI scheme string to use as an image source. What you do from the string from there is up to you, but MDN provides an example of saving the image, at least in the case of Firefox. At the very least you can create a new image element on your document and set its src to the result string, then allow a user to save the image.
Coming down the pipe as of this May is a new HTML 5 specification for canvas.ToBlob() but that will take quite some time before it’s supported. Last I read, no one has yet implemented it, as there’s a bit of a waiting game until the specification is clearer and more finalized.