OK that did it! It is important to make sure to identify the reqId in the static pages as '0' and '1'. Once I did that and combined it into one script as suggested by MC Get Vizzy it works.
Thanks for your help. Trent On Aug 26, 4:01 am, MC Get Vizzy <[email protected]> wrote: > It's probably a better idea to have a single script that handles both > timelines, as in the following: > > <html> > <head> > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > > google.load('visualization', '1', {packages: ['annotatedtimeline']}); > google.setOnLoadCallback(init); > > function init() { > var velocityQuery= new google.visualization.Query('http://www.lrd- > wc.usace.army.mil/olmsted/velocitySetResponse'<http://wc.usace.army.mil/olmsted/velocitySetResponse%27> > ); > velocityQuery.send(handleVelocityQueryResponse); > var stageQuery= new google.visualization.Query('http://www.lrd- > wc.usace.army.mil/olmsted/stageSetResponse'<http://wc.usace.army.mil/olmsted/stageSetResponse%27> > ); > stageQuery.send(handleStageQueryResponse);} > > function handleVelocityQueryResponse(response) { > if (response.isError()) { > alert('Error in stage query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return;} > > var data = response.getDataTable(); > var visualization = new > google.visualization.AnnotatedTimeLine(document.getElementById('velocity_div')); > visualization.draw(data, {allValuesSuffix: " fps", displayAnnotations: > true, displayZoomButtons: false , displayRangeSelector: false, > scaleType: 'maximized'});} > > function handleStageQueryResponse(response) { > if (response.isError()) { > alert('Error in stage query: ' + response.getMessage() + ' ' + > response.getDetailedMessage()); > return;} > > var data = response.getDataTable(); > var visualization = new > google.visualization.AnnotatedTimeLine(document.getElementById('stage_div')); > visualization.draw(data, {allValuesSuffix: " ft", displayAnnotations: > true, displayZoomButtons: false , displayRangeSelector: false, > scaleType: 'maximized'}); > > } > > </script> > > </head> > <body> > <h1>Velocity (fps)</h1> > <div id="velocity_div"; style='width: 700px; height: 240px;'></ > div> > <h1>Stage (feet)</h1> > <div id="stage_div"; style='width: 700px; height: 240px;'></div> > </body> > </html> > > I'm kind of hoping that will solve the problem. If it doesn't, let me know. > > thanks, > > MC Get Vizzy > > > > On Wed, Aug 25, 2010 at 2:10 PM, Trent <[email protected]> wrote: > > I'm trying to get two annotated time lines on the same webpage. I'm > > getting an error returned from the query "Missing query for request > > id: 0". > > > The data is in two static pages here: > >http://www.lrd-wc.usace.army.mil/olmsted/velocitySetResponse > >http://www.lrd-wc.usace.army.mil/olmsted/stageSetResponse > > > I've tried changing the reqId to 0 and 1 in the query responses, but > > that didn't fix it. > > > Here's the code I'm using: > > > <html> > > <head> > > <script type="text/javascript" src="http://www.google.com/jsapi"></ > > script> > > <script type="text/javascript"> > > > google.load('visualization', '1', {packages: ['annotatedtimeline']}); > > google.setOnLoadCallback(init); > > > function init() { > > var query= new google.visualization.Query('http://www.lrd- > > wc.usace.army.mil/olmsted/velocitySetResponse'<http://wc.usace.army.mil/olmsted/velocitySetResponse%27> > > ); > > query.send(handleQueryResponse); > > } > > function handleQueryResponse(response) { > > if (response.isError()) { > > alert('Error in stage query: ' + response.getMessage() + ' ' + > > response.getDetailedMessage()); > > return; > > } > > var data = response.getDataTable(); > > var visualization = new > > > google.visualization.AnnotatedTimeLine(document.getElementById('velocity_div')); > > visualization.draw(data, {allValuesSuffix: " fps", displayAnnotations: > > true, displayZoomButtons: false , displayRangeSelector: false, > > scaleType: 'maximized'}); > > } > > </script> > > <script type="text/javascript"> > > google.load('visualization', '1', {packages: ['annotatedtimeline']}); > > google.setOnLoadCallback(init); > > > function init() { > > var query= new google.visualization.Query('http://www.lrd- > > wc.usace.army.mil/olmsted/stageSetResponse'<http://wc.usace.army.mil/olmsted/stageSetResponse%27> > > ); > > query.send(handleQueryResponse); > > } > > function handleQueryResponse(response) { > > if (response.isError()) { > > alert('Error in stage query: ' + response.getMessage() + ' ' + > > response.getDetailedMessage()); > > return; > > } > > var data = response.getDataTable(); > > var visualization = new > > > google.visualization.AnnotatedTimeLine(document.getElementById('stage_div')); > > visualization.draw(data, {allValuesSuffix: " ft", displayAnnotations: > > true, displayZoomButtons: false , displayRangeSelector: false, > > scaleType: 'maximized'}); > > } > > > </script> > > > </head> > > <body> > > <h1>Velocity (fps)</h1> > > <div id="velocity_div"; style='width: 700px; height: 240px;'></ > > div> > > <h1>Stage (feet)</h1> > > <div id="stage_div"; style='width: 700px; height: 240px;'></div> > > </body> > > </html> > > > -- > > 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]<google-visualization-api%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-visualization-api?hl=en.- Hide quoted > >text - > > - Show quoted text - -- 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.
