Hi guys,

I'm trying to implement google charts in one of my projects, but just can't 
get my head around how to construct a column array in PHP which will comply 
with Json formatting. In summary, this is what I have:

1) MySQL table with two columns "Country", "Rating", both of which hold 
string values (example: Germany can have a rating of "Good" or "Bad", 
depending on entries by users and their view on Germany).

2) In order to construct a numeric value, i.e. how many times has Germany 
been rated as "Good" for example, I have a following SQL query in my php 
file, which works as expected:

    $query = "SELECT rating, country, COUNT(*) AS RatingPerCountry FROM 
userdata GROUP BY rating, country";

3) A problem that I'm facing is how to code a dynamic array of countries as 
columns in Google Charts, which will hold numeric values, because all the 
PHP examples I've seen only have a static numeric colum, which can be 
labeled as "Country" for example. What I really need  instead of static 
label "Country", is to dynamically import countries from my database as 
columns. Does that make sense? 

I've constructed an example in Google Playground of how I'd expect my chart 
to look like. Thanks in advance for any help I can get:


<https://lh3.googleusercontent.com/-yt_hdYoUftk/UU2ZsZVsBMI/AAAAAAAAABk/QqNCOYk3uN0/s1600/Screen+shot+2013-03-23+at+11.30.01.png>

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


Reply via email to