Hi,

In general there are two ways you can go about getting the data from your
server to the visualizations on the client-side.

1. Generate the html page dynamically (Asp .NET does this well) and put in
the html some static javascript containing your data table's json. For
instance, you have a url www.myserver.com/mypage.aspx which generates an
html page containing, among other things this:
<script>
var json = {cols: [...], rows: [...]};
var dataTable = new google.visualization.DataTable(json);
...
</script>

2. Become a data source. You need to conform to the protocol described here:
http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html
Then you need to expose a url (can be a web service, i believe, if a web
service doesn't have problems with returning a simple text string without
any special headers it adds itself).
Say you expose www.myserver.com/myservice
And then in the client side (this can be a static html file, or a dynamic
one created by Asp .NET, doesn't matter) you can have something like this:
<script>
var query = new google.visualization.Query('
http://www.myserver.com/myservice');
query.send(handleResponse);
function handleResponse(response) {
...
}
</script>
See further documentation of sending requests via the Query object here:
http://code.google.com/apis/visualization/documentation/queries.html

To choose between 1 and 2, the main thing that should guide you is whether
you write all your own pages (choose 1) or whether you will want your data
to be accessed by pages written by someone else, or by Google Visualization
Gadgets, etc (choose 2).

Hope this helps.

- VizBoy.

On Wed, Apr 1, 2009 at 12:13 AM, Ned <[email protected]> wrote:

>
> Hello,
>
> I have a Web Application Report Engine written in C# which will take
> user parameters, run a SQL query to get Report Data, and then make
> some modifications to the DataSet before finally outputting it to the
> screen as an ASP GridView.  I've been experimenting with the Google
> Visualization API, and thought I would try using the API as a graphing
> engine for all my data.  My question is, what is the best way to
> access the data generated by the C# code inside the javascript for the
> Google Vis. API?
>
> I was experimenting with writing a C# WebService that would output a
> JSON formatted string which represents the C# DataSet.  The WebService
> is correctly outputting the JSON string, but how do I call the
> WebService using the google javascript?
>
> Additionally, is there a better way of going about this rather than
> the creation of a WebService to output data?
>
> Thanks!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to