The google#setOnLoadCallback method accepts a function as a parameter.
When you pass "drawVisualization(myData)" to it, it actually executes the
drawVisualization function and passes the return value to
#setOnLoadCallback. What you would need is something like this:
google.setOnLoadCallback(init);
function init () {
drawVisualization(mydata);
}
Also note that google.visualization might not exist at the time you call it
unless you call it inside the google load callback function, like this:
function init () {
var mydata = google.visualization.arrayToDataTable([
["Name", "Gender", "Age", "Donuts eaten"],
["David", "Male", 34, 20],
["Lisa", "Female", 23, 7]
]);
drawVisualization(mydata);
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/iPM6Rml2hfoJ.
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.