Actually, here's a better example from the AppScript docs.

https://developers.google.com/apps-script/reference/charts/data-view-definition-builder?hl=en

Thomas Rybka | Software Engineer | [email protected] | Google


On Thu, Jul 11, 2013 at 1:57 PM, Thomas Rybka <[email protected]> wrote:

> Hi there,
>
> You can use the setDataSourceUrl method to use a spreadsheet:
>
> e.g.
>
> var tableChart = Charts.newTableChart()
>       *.setDataSourceUrl('
> http://spreadsheets.google.com/tq?key=pCQbetd-CptGXxxQIG7VFIQ&range=B1:D11&pub=1
> ')*
>       .build();
>
> Note that we change the ccc in the url to tq.
>
> You can then apply data views, etc. if you like.
>
> Here's some more information on how to use spreadsheets as a dataSource:
> https://developers.google.com/chart/interactive/docs/spreadsheets
>
> They support things like range filters, and picking which sheet, etc.
> Thomas Rybka | Software Engineer | [email protected] | Google
>
>
> On Mon, Jul 8, 2013 at 1:51 AM, Samantak Bagchi 
> <[email protected]>wrote:
>
>> Hi,
>>
>> I have been using the Google Chart API in Apps Script to build
>> dashboards. So, far I have drawn the data from the spreadsheet by using
>> .openById type. However, I would like to use Combo, 100% stacked and motion
>> charts and is there a way I can still connect my dashboard/charts to the
>> google spreadsheet instead of manually typing in the data such as
>> arraytoDataTable method?
>>
>> var data = google.visualization.arrayToDataTable
>>
>> In all the examples mentioned in the Google Code Playground, the data has
>> been mentioned
>> in the charts which is fine as an example but for spreadsheet with 900
>> rows and
>> columns, manually typing in the data may not be the best method. Any
>> workaround assuming
>> I still want to host the data on a Google spreadsheet?
>>
>>
>> *My current version*
>>
>> var ss =
>> SpreadsheetApp.openById('0AmSp_yYHF4BrdGlOYVpMOW1reGgzcjNKQy1BYZ0tS3c');
>>   var data = ss.getDataRange();
>>
>>
>>   var tableChart = Charts.newTableChart()
>>
>> .setDataViewDefinition(Charts.newDataViewDefinition().setColumns([1,2,3,4,5,6,7,8,9,10]))
>>       .build();
>>
>>
>>
>> Best,
>> Samantak
>>
>>
>>  --
>> 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/groups/opt_out.
>>
>>
>>
>
>

-- 
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/groups/opt_out.


Reply via email to