0
votes

Basically I am creating an app where I get data from Google Analytics store it in spreadsheets so i can render this into a nice looking chart. (Thats the end goal) What I created was an html page that has 2 input boxes with dates "from date" and "to date". With 2 buttons "reache" and "filter" If you recache the data it will run the analytics function to gather the data and store it and filter will just use a google query to get the data in the date range from the cache.

The reache works fine, when i click it, the function runs and updates the spreadsheet. The filter function on the other hand does not work, I am unable to add google charts

    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
  google.load('visualization', '1', {packages: ['table']});
</script>

Reading this (http://googleappsdeveloper.blogspot.ca/2013/03/retiring-a-few-apps-script-components.html) I found out its best not to use the UiService and rather stick to the Html Service because the ui service might eventually be unsupported. ( i know its possible to use the uiservice to make the charts but didnt read much on it because of the above article figured I would focus on using HtmlService.

Reading this (https://code.google.com/p/google-apps-script-issues/issues/detail?id=2949) I am unable to use google visualization to take my spreadsheet data and generate a view.

Does anyone have any suggestions for me on how I am to go about creating views using google visualization class. Maybe I am doing this wrong? Possibly a link or 2 for me to read.

1
What suggestions are you looking for? It's not clear from you question. - Trident D'Gao
how can i make google charts using htmlService - Silvio
Google Charts are completely independent from anything consider this chart: chart.googleapis.com/…? - Trident D'Gao
I've been using a javascript library called Peity that works. It's not as full featured as the Google Visualization API, but it works because it uses canvas instead of svg. - Fred

1 Answers

3
votes

You cannot use google visualization chart library with html service as long as caja does not allow it.

I think we will have to wait for a long time before it happens.

If you want to use Google Charts you will have to use UiApp for now.

Thierry


05/05/14

Great news, I just tested and succeeded in including "https://www.google.com/jsapi" and managed to create a pie chart.

jsapi library is now accepted by HTMLService.

Thierry