I am trying to combine the queries before drawing the timeline chart.

24 views
Skip to first unread message

Dave Hofbauer

unread,
Mar 10, 2021, 10:54:19 PM3/10/21
to Google Visualization API
My working code is below, but it chokes when I add more than 5 queries. Can anyone offer some guidance?

 var dataA = "";
  var dataB = "";
function initialize() {
  var opts = {sendMethod: 'auto'};
  var queryString = encodeURIComponent('SELECT J, K, C, E, F WHERE I=1');
  var queryA = new google.visualization.Query(
  
  var queryB = new google.visualization.Query(
queryA.send(handleQueryResponse);
queryA.send(getDataA);
queryB.send(getDataB);

}

function handleQueryResponse(response) {
  if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage());
return;
  }
}
function getDataA(response){ 
dataA = response; 
drawThatChart();    
}
function getDataB(response){
  dataB = response;
  drawThatChart();
}
function drawThatChart(){

drawChart(dataA, dataB);

}

function drawChart(a, b) {
Reply all
Reply to author
Forward
0 new messages