The client has many Google spreadsheets containing data from which they created diagrams on new sheets in the book. I provided code that allows them to publish a diagram (which previously generated an element <script>containing JSON), copypaste the published JSON in their CMS, and the end result was responsive <iframe>. The chart is widthmodified on the fly to fit the container, and the usual trick is to reload the chart when resizing the browser, saving it that way.
However, Google Sheets has been updated, and new customer charts have the ability to publish as βLinkβ or βPasteβ, where the latter is just <iframe>wrapped around the former. Since the text is <iframe>published with a fixed width, I updated my code to handle this alternative by changing the widthiframe attribute on the fly.
The problem is that the internal content of this iframe is now fully generated by Google with a fixed width , rather than a width that matches the containing iframe (the width of which I set).
I can not contact the iframe to modify the document from the script, as it comes from another domain. The original chart embedded in the spreadsheet is responsive (resizing the browser window containing the spreadsheet greatly resizes the chart), but I donβt see any way to support this effect during publication.
I could move everything to a script that uses the visualization API directly, but then it doesn't use the pre-created client diagrams (and it seems that every diagram they create is different from the style / layout that would be a supporting nightmare).
So: how can I publish a pre-existing chart from a Google Sheets document, and the published result reacts just like the original chart?