Google Docs/Apps API:带有图表的电子表格 (Google Sheets)

发布于 2024-08-08 12:38:47 字数 415 浏览 8 评论 0原文

有没有一种方法可以自动执行从 .NET 应用程序在 google 文档中创建图表的过程。

我正在寻找的工作流程是...

  1. 创建 Excel 文档。
  2. 上传到 Google 文档。
  3. 在电子表格上创建图表。 (无法弄清楚这一点。)
  4. 使用 ACL 发布。 (奖励)

我不确定我是否应该使用 Google Chart API 或纯电子表格 API。

我正在使用 GData .NET 客户端库。

http://code.google.com/p/google-gdata/

Is there a way to automate the process of creating a chart within a google doc from a .NET application.

The workflow I'm looking for is...

  1. Create Excel Document.
  2. Upload to Google Docs.
  3. Create charts on the spreadsheet. (Can't figure this out.)
  4. Publish using ACLs. (bonus)

I'm not sure if I'm supposed to use the Google Chart API for this or pure Spreadsheet API.

I'm using the GData .NET client library.

http://code.google.com/p/google-gdata/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

╰◇生如夏花灿烂 2024-08-15 12:38:47

(2016 年 6 月) 最初接受的答案现已过时。自 Google I/O 2016 起,您可以通过 Google Sheets API 在工作表中创建图表。首先要做的事情是:1) GData API 是上一代 Google API...而并非所有 API 均已弃用,所有较新 Google API 请勿使用Google 数据协议; 2) 有新的 Google Sheets API v4 (不是 GData])。

从这里开始,您需要获取适用于 .NET 的 Google API 客户端库并使用最新的 Sheets API,它比任何以前的 API 都更强大、更灵活。这是一个C# 代码示例,可帮助您入门。如果您对 Python 不过敏,我制作了一个视频 介绍了新的 API,并通过 一篇博文,您可以从中学习并根据需要有效地迁移到 C#。如果您对 JavaScript 不过敏,并且想尝试更复杂的实践示例,可以使用我们的 Google 表格 Codelab 中的项目 使用 API 创建图表和数据透视表。然后您可以推断如何在 C# 中执行此操作。

关于发布sharing/ACL,两者都是通过 Google Drive API,因为这些是更通用的操作,您可以应用于表格、文档、幻灯片。

(Jun 2016) The original accepted answer is now out-of-date. As of Google I/O 2016, you can create charts within a Sheet from the Google Sheets API. First things first: 1) GData APIs are the previous generation of Google APIs... while not all have been deprecated, all newer Google APIs do not use the Google Data Protocol; and 2) there is a new Google Sheets API v4 (not GData]).

Moving forward from here, you need to get the Google APIs Client Library for .NET and use the latest Sheets API, which is much more powerful and flexible than any previous API. Here's a C# code sample to help get you started. If you're not allergic to Python, I made a video introducing the new API and gave a deeper dive into its code via a blogpost that you can learn from and effectively migrate to C# if desired. If you're not allergic to JavaScript and want to try a more complex hands-on example, the project in our Google Sheets codelab creates a chart and a pivot table using the API. You can then extrapolate how to do this in C#.

With regards to publishing and sharing/ACLs, both are done w/the Google Drive API because these are more general operations you can apply to Sheets, Docs, and Slides.

傻比既视感 2024-08-15 12:38:47

更新:谷歌员工在谷歌论坛上确认这是不可能的......

UPDATE: Confirmed by a Google employee on the Google forum this is not possible...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文