简体   繁体   中英

Integrate Google Chart Interactive with ASP.NET and C#

我想使用带有ASP.NET和C#的Google Chart Interactive创建图表,发现此示例http://code.google.com/apis/visualization/documentation/using_overview.html,但是我发现了如何将其与c#集成的问题以及如何将数据从C#集成到javascript ..有人可以提示我应该怎么做?

What you need to do is send the command to the google charts api and convert the response to an image like below, and then you can take the image object and write it to a file or perform any operation you want:

 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM