I have an EmbeddedChart on a spreadsheet and usually I publish it manually as an image and add it to a confluence page. This way whenever the chart is updated in the spreadsheet, it is also updated in the confluence page. Now I'm trying to automate the creation of the confluence markup that is used to create the confluence page, but I'm not able to publish and get the EmbeddedChart url in the apps script that is creating the confluence markup.
Is there a way to publish a google spreasheet chart to the web (Chart->Publish Chart...->) using google apps script? Or is there a way to get the published URL?
You can also use the Charts API to create the chart inside your html code. From there you can call apps script to retrieve the information from the spreadsheet or directly query the spreadsheet.
In the following example you would call the api and set the package in this case is the "bar" package. Then a query object is created and then you would set the query to the spreadsheet.
After querying the sheet, we will create the chart with the desired options and then call the function draw with the parameters "data" which contains the information obtained from the query and the options.
This Api gives a lot of options for different charts. I hope it helps.