Your a Star!

thank you


On Thursday, 30 May 2013 19:45:57 UTC+1, [email protected] wrote:
>
> Hi am trying to display the data of a Google Spreadsheet in a table with 
> the below code that I have pieced together from the tutorials.
>
> The Google Spreadsheet is updated every day and I only want to show the 
> data from the last five rows.
>
>  <script type="text/javascript" src="http://www.google.com/jsapi
> "></script>
>
>     <script type="text/javascript">
> google.load('visualization', '1', {packages: ['table']});
> var weeklyurl = 'MY - URL';
>     var weeklyVisualization;
>
> function draw() {
>       drawVisualization();
>       drawToolbar();
>     }
>     function drawVisualization() {
>       var query = new google.visualization.Query(weeklyurl);
>       query.setQuery('SELECT A,C,F,H,M');
>
>       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('weeklyVisualization'));
>       visualization.draw(data);
>     }
>     function drawToolbar() {
>       var components = [
>        
>         {type: 'html', datasource: weeklyurl},
>         {type: 'csv', datasource: weeklyurl},
>         {type: 'htmlcode', datasource: weeklyurl,
>           gadget: 'http://www.google.com/ig/modules/table.xml'}
>       ];
>     
>       var container = document.getElementById('toolbar_div');
>       google.visualization.drawToolbar(container, components);
>     };
>     
>
>     google.setOnLoadCallback(draw);
>     </script>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to