.net - In a C# console app, how could I generate a Google Charts API request and save the result as an image? -



.net - In a C# console app, how could I generate a Google Charts API request and save the result as an image? -

is possible create phone call google charts api in console app , save result jpeg or png file? can in web app, not quite sure how in c#.

many thanks-

https://chart.googleapis.com/chart

you utilize googlechartsharp wrapper charts api url @ can view chart.

using httpwebrequest , httpwebresponse classes (or webclient class per joey's answer), capture response stream byte array (the image) , write file proper extension (a *.png file). like:

string charturl = chart.geturl(); byte[] chartbytes = null; webclient client = new webclient(); chartbytes = client.downloaddata(charturl); using (var memstream = new memorystream()) { memstream.write(chartbytes, 0, chartbytes.length); } file.writeallbytes("c:\temp\mychart.png", chartbytes);

c# .net google-visualization

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -