谷歌电子表格有列图表,但我想使用“绘制注释”,如这 (注释)。列图表不显示条形图值为“绘制注释”在顶部。
我的图表包括:
第一栏:销售集团,
第二栏:产品销售数量,
第三栏:营业额
我找到下面的代码,但它不能在我的工作表上工作。
function getValueAt(column, dataTable, row) {
return dataTable.getFormattedValue(row, column);}
function setLabelTotal(dataTable) {//dataTable must have role: annotation
var SumOfRows = 0;
for (var row = 0; row < dataTable.getNumberOfRows(); row++) {
SumOfRows = 0;
for (var col = 0; col < dataTable.getNumberOfColumns(); col++) {
if (dataTable.getColumnType(col) == 'number') {
SumOfRows += dataTable.getValue(row, col);
}
if(dataTable.getColumnRole(col) == 'annotation')
{dataTable.setValue(row, col, SumOfRows.toString());}
}
} }
发布于 2015-05-05 19:44:37
谷歌开发者-谷歌图表中的图表库是关于使用代码创建图表的演示集。这些图表不能插入到Google表中,但它们可以将Google电子表格作为数据源。
值得指出的是,可以插入到Google电子表格中的列图,但是添加注释可能有点棘手。
对于每个系列,使用两列,一列用于条形图值,另一列用于注释。示例
Google和Google电子表格是紧密集成的。您可以将Google图表放置在Google电子表格中,Google可以从Google电子表格中提取数据。本文档向您展示了如何做到这两种方法。
https://webapps.stackexchange.com/questions/76705
复制相似问题