.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
Post a Comment