Google 图表数据编码

发布于 2024-07-09 09:02:45 字数 328 浏览 11 评论 0原文

我最近开始研究 Google Charts API 在我正在开发的产品中的可能用途。 为给定图表构建 URL 时,可以用三种不同的格式指定数据点:未编码、使用简单编码和使用扩展编码 (http://code.google.com/apis/chart/formats.html)。 然而,似乎无法回避这样一个事实:为数据点指定的最高值正在使用扩展编码,在这种情况下为 4095(编码为“..”)。

我在这里错过了什么还是这个限制是真实的?

I have recently started looking into Google Charts API for possible use within the product I'm working on. When constructing the URL for a given chart, the data points can be specified in three different formats, unencoded, using simple encoding and using extended encoding (http://code.google.com/apis/chart/formats.html). However, there seems to be no way around the fact that the highest value possible to specify for a data point is using extended encoding and is in that case 4095 (endoded as "..").

Am I missing something here or is this limit for real?

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

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

发布评论

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

评论(2

背叛残局 2024-07-16 09:02:45

使用 Google Chart API 时,您通常需要自行缩放数据,使其符合 API 要求的 0-4095 范围。

例如,如果您的数据值介于 0 到 1,000,000 之间,那么您可以将所有数据除以 245,使其符合可用范围 (1000000 / 245 = 4081)。

When using the Google Chart API, you will usually need to scale your data yourself so that it fits within the 0-4095 range required by the API.

For example, if you have data values from 0 to 1,000,000 then you could divide all your data by 245 so that it fits within the available range (1000000 / 245 = 4081).

你的背包 2024-07-16 09:02:45

根据数据缩放,这也可能对您有所帮助:

http://code.google。 com/apis/chart/formats.html#data_scaling

请注意 chds 参数选项。

您可能还希望考虑利用包装 API 来抽象掉一些丑陋的细节。 它们列于此处:

http:// /groups.google.com/group/google-chart-api/web/useful-links-to-api-libraries

我写了charts4j 它具有帮助您处理数据缩放的功能。

Per data scaling, this may also help you:

http://code.google.com/apis/chart/formats.html#data_scaling

Note the chds parameter option.

You may also wish to consider leveraging a wrapper API that abstracts away some of these ugly details. They are listed here:

http://groups.google.com/group/google-chart-api/web/useful-links-to-api-libraries

I wrote charts4j which has functionality to help you deal with data scaling.

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