Search code examples
google-visualizationgoogle-apps-scriptgoogle-caja

Can we use Google Chart Tools with Google Script HtmlService


I would like to use Google Chart Tools in Google Scripts using the HtmlService. But I do not know if caja will allow to inject script to show a chart. My first tests give me blank pages.

Does anyone know if it is at least possible ?

I know Google Script provides 'Charts' service, but the features are limited compared to what allows Google Chart Tools.

Thanks,


Solution

  • If you look at the HtmlService documentation under the Caja section, https://developers.google.com/apps-script/html_service#Caja it says that included libraries are sanitized and so far only JQuery is supported.

    Since Chart Tools depend on Google's jsapi, and it appears to do some pretty funky magic, I'd bet it won't pass Caja sanitization right now.

    I wonder if there's some way to use the GAS Charts library to produce the charts (albeit statics ones)? But it produces blobs and I'm not sure how to integrate those into the HtmlService's page?!