Your onchange event handler for the <select> element does not process the 
selected value correctly.  Remove the "onchange" event handler from the 
<select> element, and change the name parameter to id:

<select id="users">

Then, in your javascript, add a callback from the google loader that sets 
up the event handler:

function init () {
    $('#users').change(function () {
        var val = $(this).find(':selected').val();
        drawChart(val);
    });
}
google.load('visualization', '1', {'packages':['corechart', 'table'], 
callback: init});

This ensures that the Visualization API is loaded and ready to use before 
you can attempt to draw a chart.

On Tuesday, May 27, 2014 11:59:25 AM UTC-4, Guillaume DIGOIN wrote:
>
> I want to do something like what you will find attached.[image: Images 
> intégrées 1][image: Images intégrées 2][image: Images intégrées 3]
> Step 1 : select your countries
> Step 2 : Push the select bottom
> Step 3 : Show different kind of google graphs with data refers to the 
> country you ticked.
>
> For that, i found  that website : 
> http://sophiedogg.com/creating-a-google-pie-chart-using-sql-data/ (and 
> here 
> https://developers.google.com/chart/interactive/docs/php_example?hl=fr)
> where the person did exactly what i want to do but with a pie chart. I 
> would like to do it with other kind of charts.
>  Let's take an example of what i want to do:
>
> the user select canada and the US. then push the send button. on the same 
> page i want to be able to show google graphs with preselected factors i 
> want to put in. For example, i want to show the GDP of those two countries 
> on a graph like this one 
> https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart
>  over 
> 10 years.
> Then a second graphs which would take the 10 best values of a table and 
> show it.
> For that, i built a  database like this:[image: Images intégrées 4]
>
> where "facteurs" are my factors (GDP for instance)
> Nom is the name of the factor
> Pays is the name of the countries
> Valeur is the value and annee is the year.
>
> I'm currently trying to do the pie chart with my data, just to see if it 
> works. You can check my php files. The next step would be to implement this 
> on a wordpress page.
>
> I don't know why it's not working.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to