Google Apps脚本EmbeddedComboChartBuilder不允许更改方向

问题描述 投票:2回答:1

我正在尝试以编程方式构建垂直组合图。可以通过将ComboChart的“ orientation”选项设置为“ vertical”(根据https://developers.google.com/chart/interactive/docs/gallery/combochart)来完成]

如果在上面链接的页面上的第一张图片下面打开JSFiddle并添加选项“ orientation:'vertical',“,则此方法很好,

    var options = {
      title : 'Monthly Coffee Production by Country',
      orientation: 'vertical',
      vAxis: {title: 'Cups'},
      hAxis: {title: 'Month'},
      seriesType: 'bars',
      series: {5: {type: 'line'}}        };

但是,在Google Apps脚本中创建EmbeddedComboChart时,设置相同的选项不会有任何改变(结果图表处于标准水平方向)。

function createEmbeddedComboChart() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var chartDataRange = sheet.getRange(
    'Tabellenblatt1!B10:D12');

  var comboChartBuilder = sheet.newChart().asComboChart();
  var chart = comboChartBuilder
    .addRange(chartDataRange)
    .setOption("orientation", "vertical")
    .setPosition(5, 8, 0, 0)
    .build();

  sheet.insertChart(chart);  
}

我是否缺少某些东西,或者将图表嵌入Google表格中时根本无法使用此选项?]

我正在尝试以编程方式构建垂直组合图。这可以通过将ComboChart的“ orientation”选项设置为“ vertical”来完成(根据https://developers.google.com/chart / ...

google-apps-script charts google-visualization orientation
1个回答
0
投票

无法为嵌入式电子表格图表构建器设置选项"orientation", "vertical"的原因是Google表格用户界面中没有此类选项

© www.soinside.com 2019 - 2024. All rights reserved.