将Google Chart Interactive与ASP.NET和C#集成

我想使用带有ASP.NET和C#的Google Chart Interactive创建图表

我发现这个例子
http://code.google.com/apis/visualization/documentation/using_overview.html但是我发现问题如何用c#集成这个以及如何将c#中的数据集成到javascript中.

谁能暗示我应该做什么? 最佳答案 您需要做的是将命令发送到谷歌图表api并将响应转换为如下图像,然后您可以获取图像对象并将其写入文件或执行您想要的任何操作:

 string ChartURL = "http://chart.apis.google.com/chart?";
            ChartURL += "chxr=0,0," + MaxX + "";
            ChartURL += "&chxt=y";
            ChartURL += "&chbh=a";
            ChartURL += "&chs=" + ChartWidth + "x" + ChartHeight + "";
            ChartURL += "&cht=bvg";
            ChartURL += "&chco=" + ChartColors + "";
            ChartURL += "&chds=" + ChartDataRange + "";
            ChartURL += "&chd=t:" + ChartValues + "";
            ChartURL += "&chdl=" + ChartLegend + "";
            ChartURL += "&chtt=" + ChartTitle + "";

            HttpWebRequest myRequest = WebRequest.Create(ChartURL) as HttpWebRequest;
            HttpWebResponse ServerResponse = myRequest.GetResponse() as HttpWebResponse;
            Stream ResponseStream = myRequest.GetResponse().GetResponseStream();
            return System.Drawing.Image.FromStream(ResponseStream);
点赞