Igor
Igor

Reputation: 11

google.visualization chart - DataTable in google site

I'm not understand how to implement chart in Google site. My goal is to show spreadsheet. I'm choose to use the charts from google.visualization.DataTable with dashboard.

This is my steps:

1) Create new project from apps script project.

2) add file Code.gs:

function doGet() {
 return HtmlService.createTemplateFromFile('myPage').evaluate();
}

3) add file myPage.html i take the example from https://developers.google.com/chart/interactive/docs/gallery/controls?hl=en

I'm add to body "Hello world!" for test.

4) test this HTML code in Google play ground (all work fine)

5) Go to the edit page in my Google site and add this script to page Insert -> Apps script gadget

6) Save, Reload

As result in my page I see "Hello world!" but table is absent! What is wrong? What is the bast way to show table from Google spreadsheet with filers?

Upvotes: 1

Views: 744

Answers (2)

Thierry Chevillard
Thierry Chevillard

Reputation: 522

Zig is right, caja does not support google.visualization libs so far.

What you need is to use the Charts module in GAS UiApp: https://developers.google.com/apps-script/reference/charts/

You can create data table and dashboard. They will look the same as if you have used google.visualization.

Best,

Thierry

Upvotes: 0

Zig Mandel
Zig Mandel

Reputation: 19835

See the docs about caja and htmlservice. Those Chart libs are not supported.

Upvotes: 1

Related Questions