On 05/19/2011 05:43 AM, everest_man27 wrote:
I have sensitive data and would not like to send this to google server
instead would like to use the javascript charts visualisation api and
avoids having to send the data to the  server. Can you advise on how
to connect the mysql to the visualization api.
Hi,
sorry, may be I'm missing something... but did you try with the Data Source Library (http://code.google.com/p/google-visualization-java)? With that library you can easily build a Java servlet exposing your MySQL tables (or views..) as datasource, ready to be used by the javascript google charts.

Regards,
Luca


Thanks


On May 18, 7:49 pm, Still<[email protected]>  wrote:
Just build the URL from your retrieved data. Here is a sloppy example
for a
pie chart function.

function piechart($data, $name = 'piechart') {
         $counter = count($data['metrics']);
         $columns = (count($data,1)/count($data,0))-1;
         $return = "<img src='http://chart.apis.google.com/chart?";;
         $return .= "chs=600x200&";
         $return .= "cht=p&";
         $return .= "chco=3399CC,FF9900,80C65A,7777CC,990066,999999&";
         $return .= "chd=t:";
         $total = 0;
         foreach ($data['values'] as $key =>  $value)
           {
               $total += $value;
         }
         $i = 0;
         foreach ($data['values'] as $key =>  $value)
           {
               if ($i == 0){
                   $return .= ($value/$total*100);
               } else {
                   $return .= ",".($value/$total*100);
               }
               $i++;
         }
         $return .= "&chl=";
         foreach ($data['metrics'] as $key =>  $value)
           {
               $return .= $value."|";
         }
         $return .= "' />";
         return($return);
     }

On May 19, 12:21 pm, everest_man27<[email protected]>  wrote:



I have a similar challenge - looking for advise on how to link mysql
using php into google visualization api to be able to create dynamic
chart. The documentation on connecting to data source is not clear on
how to connect to a mysql data base.
Advise on how to connect to mysql is greatly appreciated.
Thank you.
On May 18, 6:26 pm, GutoW<[email protected]>  wrote:
Hi, I'm a brazillian developper and i'm need a help with google chart
api and mysql with php.
I have some tables where i create a query for give me the results. At
here it's ok, but how i get the information of my query and sent to
google chart api to give the chart to put on my website...? i'm
looking for some codes in the web but i don't codify to give my
prupose.
Any body help-me ?
Ps.: Sorry my english is poor...- Hide quoted text -
- Show quoted text -

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