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 view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/CY6P21QN4eAJ.
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