问题
I am looking to replicate the effect that you see in this Google I/O video at the 24m55s of this video (http://youtu.be/38H7WpsTD0M?t=24m55s).
Does anyone know how this is done? The goal is to have an Apps Script webApp that shows a dynamic bar chart where its values change (and animate) upon changing of the values of the underlying spreadsheet.
回答1:
Thank you for sharing the link to this video, it was really interresting and somehow I didn't notice it...
That said, this shows a development in the very specific context of the new form edition environment and if I refer to what they say in the doc and appears in the video as well :
FormApp.getUi()
Returns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. A script can only interact with the UI for the current instance of an open form editor (not the view that a respondent sees), and only if the script is container-bound to the form.
And there are indeed triggers to know when a form has been submitted but these are only able to interact with the UI if the script is container-bounded in the form editor itself.
A user interface can indeed be build in the form editor and called by something like : FormApp.getUi().showSidebar(userInterface)
and from there you will get the interactivity you are asking for but not from a standalone webapp.
Is that how you are developing it ? from what I read in you question I can't be sure.
Also were you able to find the code they used at Google I/O for their quizz demo ? I didn't look for it yet but I'm sure it would be truly interesting to analyze. Let us know if you did and feel free to post the link.
来源:https://stackoverflow.com/questions/19893540/how-to-create-a-dynamic-chart-in-google-apps-script-ui