4

I want to create chart using Google Chart Interactive with ASP.NET and C# I was found this example http://code.google.com/apis/visualization/documentation/using_overview.html but i find problem how to i Integrated this with c# and how to integrate data from c# to javascript.. can someone hint me what I should do?

1 Answer 1

2

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);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.