如何通过 Google Chart API 显示两个系列?

发布于 2024-08-28 22:46:46 字数 956 浏览 1 评论 0原文

我无法让这两个系列的数字一起缩放。

这是示例代码,您可以将其粘贴到...
http://code.google.com/intl/en/ apis/chart/docs/chart_playground.html

cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44|3,7,1
chds=20,40,1,4,24,44,1,7
chxr=0,20,54,2|1,0,7,1
chxt=x,y
chxs=0,ff0000,12,0,lt
    1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
    Oranges
chtt=Some+Values
chts=0000ff,24

翻译:

chd=t:s,e,r,i,e,s,1|s,e,r,i,e,s,2|...ors:series1,series2,...ore:series1,series2,...
chds=<series_1_min>,<series_1_max>,...
chxr=<axis_index>,<start_val>,<end_val>,<step>|...

有问题的三个不同参数是:
chd=t:20,30,40|1,4,2|24,34,44|3,7,1 chds=20,40,1,4,24,44,1,7 chxr=0,20,54,2|1,0,7,1

任何人都可以使这个简单的示例正常工作吗?

该图表支持多个系列,但由于某种原因,我无法缩放它以便在比例范围内显示值。

任何帮助表示赞赏, 克里斯

I can't get the two series of numbers to scale together.

Here is sample code that you can paste into...
http://code.google.com/intl/en/apis/chart/docs/chart_playground.html

cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44|3,7,1
chds=20,40,1,4,24,44,1,7
chxr=0,20,54,2|1,0,7,1
chxt=x,y
chxs=0,ff0000,12,0,lt
    1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
    Oranges
chtt=Some+Values
chts=0000ff,24

Translated:

chd=t:s,e,r,i,e,s,1|s,e,r,i,e,s,2|...ors:series1,series2,...ore:series1,series2,...
chds=<series_1_min>,<series_1_max>,...
chxr=<axis_index>,<start_val>,<end_val>,<step>|...

The three varying parameters in question are:
chd=t:20,30,40|1,4,2|24,34,44|3,7,1
chds=20,40,1,4,24,44,1,7
chxr=0,20,54,2|1,0,7,1

Can anyone get this simple example working?

The chart supports multiple series but for some reason I can't scale it so that the values are displayed within scale.

Any help appreciated,
Chris

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

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

发布评论

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

评论(2

小…红帽 2024-09-04 22:46:46

经过一些练习后,我认为我需要使两组数据的 chds 值相同。我需要更多地使用它,但我想我应该为后代发布一个工作示例。

cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44,48|3,7,1,2
chds=10,50,0,10,10,50,0,10
chxr=0,10,50|1,0,10,1
chxt=x,y
chxs=0,ff0000,12,0,lt
    1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
     Oranges
chtt=Some+Values
chts=0000ff,24
chm=o,0000FF,0,-1,5,0|o,ff0000,1,-1,5,0
chg=10,10

After some practice I think I needed to make the chds values the same for both sets of data. I need to play with it more but I thought I would post a working example for posterity.

cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44,48|3,7,1,2
chds=10,50,0,10,10,50,0,10
chxr=0,10,50|1,0,10,1
chxt=x,y
chxs=0,ff0000,12,0,lt
    1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
     Oranges
chtt=Some+Values
chts=0000ff,24
chm=o,0000FF,0,-1,5,0|o,ff0000,1,-1,5,0
chg=10,10
许一世地老天荒 2024-09-04 22:46:46

正确的缩放可能很棘手。
首先尝试使用 chds='a' 进行自动缩放。

Scaling can be tricky to get right.
Try using chds='a' for automatic scaling at first.

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