Nothing seemed to work until I did this (found on another forum): sheet.updateChart(builder.setPosition(5, 1, 400, 1).build());
Interestingly if I change the second parameter to anything other than column 1 the chart collapses itself again, so it has to be in pixels at this stage :/ On Friday, November 22, 2013 12:41:36 AM UTC+10, asgallant wrote: > > You might need to the the #setDimensions method (of the chart builder) to > set the width and height of the chart > (documentation<https://developers.google.com/apps-script/reference/charts/?csw=1>). > > > > On Thursday, November 21, 2013 2:45:49 AM UTC-5, Troy Simpson wrote: >> >> The chart object doesn't seem to have the setOption method, thought the >> builder object does. I did try it but it didn't work. Can you confirm >> that the width can be set on the builder object? Otherwise, what object >> should I be referring to? Thanks for the thoughts. >> >> >> On Thursday, November 21, 2013 8:02:14 AM UTC+10, asgallant wrote: >>> >>> You should be able to call the #setOption method of the chart object to >>> set the width. If the chart width is changing when this code is run, >>> though, you might want to ask the guy who wrote it why that is happening. >>> >>> On Wednesday, November 20, 2013 3:50:20 PM UTC-5, Troy Simpson wrote: >>>> >>>> Hey, I'm using a chart in a google docs spreadsheet. The spreadsheet >>>> is collecting logging data so is growing constantly. I have a gapps >>>> script >>>> that triggers 'on edit' to expand the range of the chart which works fine. >>>> However, whenever the range is expanded for the chart, the width >>>> collapses >>>> down to the minimum width. I thought about setting the size manually but >>>> I >>>> can't find out how to do that on an existing chart, any ideas? >>>> >>>> The chart range expander comes from here: >>>> >>>> >>>> http://googleappsdeveloper.blogspot.com.au/2012/06/programmatically-managing-charts-in.html >>>> >>>> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
