So it looks like the biggest issue i was having was that my sheet wasnt shared properly? I plugged my sheet key into the code and it came back as it should! It feels good to know that I was mostly right and was missing that little (yet) crucial piece of the puzzle.
Thank you so much Daniel! On Wednesday, February 25, 2015 at 9:09:53 AM UTC-5, Daniel LaLiberte wrote: > > Christopher, > > Starting from your code, I built this jsfiddle that works: > http://jsfiddle.net/dlaliberte/1aumt2eg/ > I had to change the spreadsheet URL to one that was available publicly. > If you want to share your data, then I can see whether there is a > data-specific problem. > > The Table chart has been having some issues in the latest release of the > Google Charts code, which will complicate your learning experience, but I > don't think these problems should interfere with this simple example. > > On Mon, Feb 23, 2015 at 3:50 PM, Christopher Neu <[email protected] > <javascript:>> wrote: > >> I am trying to follow along with a tutorial I found to call data from my >> sheet into a webpage but i am getting no results. I am new to using the >> API and am pretty much an infant in any kind of coding so dont know what I >> am doing wrong and would greatly appreciate it if someone could tell me >> what the heck I am doing wrong with this code? >> >> Sorry if this looks sloppy. Like i said I am baby at this stuff. >> <html> >> <head> >> <script type="text/javascript" src="https://www.google.com/jsapi >> "></script> >> <script type="text/javascript"> >> google.load('visualization', '1', {packages: ['table']}); >> </script> >> <script type="text/javascript"> >> var visualization; >> function drawVisualization() { >> var query = new google.visualization.Query(' >> https://docs.google.com/spreadsheets/tq?key=1Hu1xJ-87QbyPyqe4iwxDVxmOl7pFYpLsn6hlOquFttQ&gid=1' >> ); >> query.setQuery('SELECT B'); >> query.send(handleQueryResponse); >> } >> function handleQueryResponse(response) { >> if (response.isError()) { >> alert('error in query: ' + response.getMessage() + ' ' + >> response.getDetailedMessage()); >> return; >> } >> var data = response.getDataTable(); >> visualization = new >> google.visualization.Table(document.getElementById('visualization')); >> visualization.draw(data, null); >> } >> google.setOnLoadCallback(drawVisualization); >> </script> >> </head> >> <body style="font-family: Arial;border:0 none;"> >> <div id="visualization" style="height:400px; width:400px"></div> >> <a href=" >> https://docs.google.com/spreadsheets/d/1Hu1xJ-87QbyPyqe4iwxDVxmOl7pFYpLsn6hlOquFttQ/gviz/tq?tqx=out:html&tq=select+B&gid=2 >> "> >> sheet</a> >> <a href="gcharts.html">Charts 1</a> >> <a href="gcharts2.html">Charts 2</a> >> <a href="gcharts3.html">Charts 3</a> >> </body> >> </html> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Visualization API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at >> http://groups.google.com/group/google-visualization-api. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > - 978-394-1058 > [email protected] <javascript:> 5CC, Cambridge MA > [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
