Yes, I finally got the call for the chart draw in the correct place
this morning.

I was also able to get the database call correct.  The delay is still
about 30 seconds.  I just finally put the data in a Google
spreadsheet.  I will try it again at a later date.

On Sep 9, 3:02 pm, asgallant <[email protected]> wrote:
> Your code to draw the chart is in the wrong place.  The query is an AJAX
> call, so by placing the draw call outside the query response handler, it
> tries to draw the chart before the query is returned.  Also, you need to get
> the data table from the response, not to feed the response itself to the
> draw call.  Something like this:
>
> function drawVisualization() {
>   var tableID = 1429987;
>   var queryText = encodeURIComponent("SELECT * FROM " + tableID);
>   var motionchart = new google.visualization.MotionChart(document.
> getElementById('visualization'));
>   var query = new google.visualization.Query(
> 'http://www.google.com/fusiontables/gvizdata?tq='+ queryText);
>   query.send(function getData(response) {
>     if (response.isError()) {
>       alert('Error in query: ' + response.getMessage() + ' ' + response.
> getDetailedMessage());
>       return;
>     }
>     motionchart.draw(response.getDataTable(), {'width': 800, 'height': 400})
> ;
>   });
>
> }
>
> Though the query URL seems to be invalid.

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