Hi, and I'm using another way, but it is very close to (2):
When client sends request to backend (PHP), I'm generating associative array
with PHP and send it in response with another parameters to client and
calling JS callback function to redraw or create chart.

I'm creating dataTable using

data = new google.visualization.DataTable(response.data, 0.5);

where response.data it is those generated associative array.
and then I call

chart.draw(data, options);

I'm using this way because there is request-response mechanism in our
system.

2009/2/26 VizBoy <[email protected]>

> Hi,
>
> As with any source of data, you have a few ways to visualize it:
> 1. If you render your html on a server that has access to the postgre
> database, and you're rendering your html using, say, php, asp, jsp,
> servlets, or whatnot, you can create the html already with javascript that
> has the data in it.
> See for example here:
>
> http://code.google.com/apis/visualization/documentation/reference.html#DataTable
>
> You can read under "should I create my DataTable in JavaScript or object
> literal notation?"
>
> 2. Use the query mechanism. This means you expose your data in some url,
> say using java Servlets, or another mechanism.
> You can read about it here:
>
> http://code.google.com/apis/visualization/documentation/dev/implementing_data_source.html
> If you use python for this, you can use the gviz_api python library to
> assist you in creating the proper format of the response.
> Read about it here:
>
> http://code.google.com/apis/visualization/documentation/dev/gviz_api_lib.html
>
> To summarize, usually option (1) i gave above is the easiest, if you're
> controlling the html on the same server that can access the data.
>
> Other people on the group are welcome to share their thoughts and
> experience with using these different methods..
>
> If you have further questions, ask and I will gladly elaborate.
>
> Regards,
>     Vizboy.
>
>
> On Thu, Feb 26, 2009 at 10:43 AM, manish <[email protected]> wrote:
>
>>
>> Hi, I just wanted to know if data can be fetched from a database in
>> POSTGRE and then data sent to the visualization package and displayed
>> as a line chart. If you could give me a example then it would be
>> really helpful. 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