如何使用 Google Visualization API 设置一系列值的背景?

发布于 2025-01-03 19:17:13 字数 357 浏览 5 评论 0原文

假设您有一个值从 1 到 100 的折线图,并且您想要显示 50 到 80 之间的值是“正常”的。如何使用 Google Visualization API 将图表的背景设置为 50 到 80 之间的绿色?

这是使用 Dundas 的示例。 20 到 40 美元是粉红色的: http://support2.dundas.com/OnlineDocumentation/WebChart2005/images/StripLinesAfter.png

Suppose you have a line chart with values from 1 to 100, and you want to show that values between 50 and 80 are "normal". How can you set the background of the chart between 50 to 80 to green using the Google Visualization API?

Here is an example using Dundas. $20 to $40 is pink:
http://support2.dundas.com/OnlineDocumentation/WebChart2005/images/StripLinesAfter.png

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

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

发布评论

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

评论(1

风流物 2025-01-10 19:17:13

不幸的是,没有直接的方法可以做到这一点。我可以立即想到两种方法:

  • 如果您对谷歌图像图表的功能感到满意(而不是交互式可视化),则 此处详细说明的填充选项 - 查看solid/gradient/lined 可能会有所帮助。
  • 使用组合图表添加上限和下限作为线系列(您的实际数据使用条形本身),以模仿“正常”区域。每次在绘图之前,这将涉及在数据表中添加两列额外的列。

Unfortunately, there's no straightforward way to do this. Two ways I can think of off the top of my head:

  • If you're happy with the functionality of the google image charts (as opposed to interactive visualization) the fill options detailed here - look at solid/gradient/lined may help.
  • Use the Combo Chart to add your upper and lower bounds as line series (where your actual data uses the bars themselves), to mimic the 'normal' area. It will involve adding two extra columns to your data table each time before drawing.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文