Is it possible to make a call to the Google Charts API in a console app and save the result as a JPEG or PNG file? I can do it easily in a web app, just not quite sure how to do it in C#.
Many thanks-
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.
You could use the googlechartsharp wrapper for the Charts API to get a URL at which you can view the chart.
Using the
HttpWebRequestandHttpWebResponseclasses (or theWebClientclass as per Joey’s answer), you could capture the response stream as a byte array (the image) and write that to a file with the proper extension (a *.png file). Something like: