需要有关方法setDataTable(table),Charts服务的文档 [英] Need documentation on method setDataTable(table), Charts service

查看:65
本文介绍了需要有关方法setDataTable(table),Charts服务的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在GAS中使用图表服务时,您可以创建不同类型的图表,并且其中大多数都有两种方法setDataTable(...)将数据推入其中:

When using Charts service in GAS, you can create different type of charts and most of them have two methods setDataTable(...) to push data in:

method setDataTable(tableBuilder)
method setDataTable(table)

对于第一个,您使用Charts.newDataTable()创建一个DataTableBuilder对象. 但是第二个文件对我来说还不够.

For the first one you create a DataTableBuilder object using Charts.newDataTable(). But the second one is not documented enough for me.

有人知道要传送给函数的对象的规范吗? 在我看来,它可以是数组或映射,但是使用它没有成功.

Does anyone know the specification of the object table to transmit to the function ? It seems to me it can be an array or a map, but I had no success in using it.

谢谢

推荐答案

第二种方法采用DataTable,这只是调用DataTableBuilder.build()的结果.不幸的是,不可能构造一个可以接受的纯JavaScript对象,而您将需要使用DataTableBuilder.

The second method takes in a DataTable, which is just the result of calling DataTableBuilder.build(). Unfortunately it's not possible to construct a pure JavaScript object that it will accept, and you'll need to use the DataTableBuilder.

这篇关于需要有关方法setDataTable(table),Charts服务的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆