Thanks for The great example. Basically I am a salesforce developer I tried this in salesforce but it is not working is require any changes to run it in salesforce please suggest me. Coming to my requirement I have a page with two Google visualization API column charts and one table i want to save it as image all in one click instead of giving separate buttons for each chart is it possible to this . If possible can you please help me.
On Wednesday, 2 November 2011 22:53:42 UTC+5:30, Riccardo Govoni wrote: > > This is a topic that pops up frequently here in the forum. Many users have > the need to convert/serialize the interactive charts they generate using > the Google Charts Tools API into static images (PNGs or equivalent) for the > user to download or further process. > > Currently the interactive charts API do not offer this feature (unless you > are in specific domains, such as within a Google Apps > Script<http://code.google.com/googleapps/appsscript/>script), unless you are > willing to regenerate your chart using the static > image APIs <http://code.google.com/apis/chart/image/> --- which however > have different semantics, making it difficult to support both. > > A quick workaround for this is to convert the SVG chart to <canvas /> and > then extract the image data from there. This allows for full client-side > pure javascript image serialization, at the cost of cross-browser support. > The solution works on Chrome,Safari,Firefox,IE9 and Opera, but IE8 and > lower does not support the necessary features for this to work (server-side > image serialization is also possible, although I won't discuss it here). > > I have written a brief tutorial and example page to show how this work. > Depending on the browsers your users use, and how flexible you can be, the > solution might be good enough for your case. > > Tutorial : > http://www.battlehorse.net/page/topics/charts/save_google_charts_as_image.html > Example page: > http://www.battlehorse.net/attach/topics/charts/google_charts_to_image.html > Source code : https://gist.github.com/1333906 > > Please note that this is somewhat an hack that I put together in the spare > time based on the popularity of topic and lack of support in the current > official API, so use at your own risk. Have a look at the tutorial for the > limitations. If I were to support image serialization for a production > service, I'd still recommend using the static image APIs mentioned above. > > Please discuss / comment / improve. > - R. > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
