Can we use Google Chart Tools with Google Script HtmlService

纵饮孤独 提交于 2019-12-04 16:42:39

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?!

Charts are not supported just yet.

I had used the Google Chart Tools before the Charts service was introduced. At the fundamental level, Google Chart Tools returns an image of the chart you wish and the data is passed to it via URL parameters.

Using general Javascript, I had developed the logic to build a URL and then get the image using UrlFetchApp and then display it on an Apps Script using UiApp.createImage().

If you can post some code, you could receive more help

This is now possible, sometime over the last 3 months or so.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!