I'm making a stacked column chart with the EmbeddedChartBuilder and I 
cannot get some of the configuration options to work. I don't have a lot of 
knowledge when it comes to scripting, just picking up pieces here and 
there, so I'm at a loss.

This is my function (minus the series options to shorten it). The function 
does create a chart, but doesn't use all the .setOption configurations. 
I've highlighted the ones that don't work in yellow.

function newChart() {

   var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"
);
   var datasheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(
"Sheet2");
   var data = datasheet.getRange("U4:AA9");
   
   var chart = sheet.newChart().addRange(data)
      .setChartType(Charts.ChartType.COLUMN)
      .setOption('isStacked', true)
      .setOption('width',500)
      .setOption('height',288)
      .setOption('legend', 'none')
      .setPosition(2,2,1,0)
      .setOption('backgroundColor',{stroke:'red', strokeWidth: 5})
      .setOption('chartArea',{'left':50, 'top':50,'width':"50%",'height':
"50%"})
      .setOption('bar.groupWidth', '90%');
       
   sheet.insertChart(chart.build());
}

Am I coding this incorrectly? I've wasted a lot of time looking stuff up 
online to no avail.

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/0600770c-db41-4b38-93d1-a66f56ca5acc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to