我正在使用EmbeddedChartBuilder动态创建图表,效果很好。基本示例:
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheet = spreadsheet.getSheetByName('Charts');
var chart = sheet.newChart()
.setPosition(1, 1, 0, 0)
.setChartType(Charts.ChartType.AREA)
.addRange(spreadsheet.getSheetByName('Data').getRange("A1:A10"))
.build();
sheet.insertChart(chart);
但是我需要使用 setOption
方法自定义图表。 The documentation says :
Sets advanced options for this chart. See https://developers.google.com/chart/interactive/docs/reference for what options are available.
但是按照他们提供的链接(/chart/interactive/docs/reference),我唯一看到的是:
试图找到vAxis
不会有任何结果。 Looking at another page on advanced chart customization ,我再次看到示例,但没有看到引用:
var options = {
width: 400,
height: 240,
title: 'Toppings I Like On My Pizza',
colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6']
};
setOption
方法的所有可用选项列表在哪里?
最佳答案
您可以在Guides上找到各种图表类型的选项。您发布的链接的页面(而不是引用页面)。 例如,条形图类型的选项如下:https://developers.google.com/chart/interactive/docs/gallery/barchart#configuration-options
关于google-apps-script - EmbeddedChart setOptions 选项在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36840059/