我使用 Google Chart Service 在 Google Apps Script 中为我的网络应用程序创建一个表格。
现在我有两个问题:
当我添加更多行和列时,列的宽度越来越小,直到出现滚动条为止。我添加了一个代码示例。我可以更改/增加图表的(最大)显示大小,以便没有滚动条吗?
我需要一个向右对齐的字符串列。对于字符串列,默认值是左对齐。我怎样才能改变这个?还有更多选项可以修改表格的格式(文本大小、颜色、粗体等)吗?
function doGet() { var app = UiApp.createApplication(); var data = Charts.newDataTable() .addColumn(Charts.ColumnType.STRING, "Name") .addColumn(Charts.ColumnType.STRING, "Gender") .addColumn(Charts.ColumnType.NUMBER, "Age") .addColumn(Charts.ColumnType.NUMBER, "Donuts eaten") .addColumn(Charts.ColumnType.NUMBER, "Donuts eaten") .addColumn(Charts.ColumnType.NUMBER, "Donuts eaten") .addColumn(Charts.ColumnType.NUMBER, "Donuts eaten") .addRow(["Michael", "Male", 12, 5]) .addRow(["Michael", "Male", 12, 5]) .addRow(["Elisa", "Female", 20, 7]) .addRow(["Robert", "Male", 7, 3]) .addRow(["John", "Male", 54, 2]) .addRow(["Jessica", "Female", 22, 6]) .addRow(["Aaron", "Male", 3, 1]) .addRow(["Margareth", "Female", 42, 8]) .addRow(["Miranda", "Female", 33, 6]) .addRow(["Miranda", "Female", 33, 6]) .addRow(["Miranda", "Female", 33, 6]) .addRow(["Miranda", "Female", 33, 6]) .addRow(["Miranda", "Female", 33, 6]) .addRow(["Miranda", "Female", 33, 6]) .build(); var tableChart = Charts.newTableChart().setDataTable(data) .build(); app.add(tableChart); return app; }