Google 图表 - 当 Y 范围更改时,图表无法正确缩放

发布于 2024-10-10 00:44:50 字数 802 浏览 0 评论 0原文

我使用一个简单的谷歌图表来描绘基准: alt text

由于大多数数据位于 50 到 100 之间,我尝试将范围缩小一点,但这会导致错误图形。 alt text

红线的第一个值在第一个图表上从 72 开始,但在第二个图表上从 87 开始。 HTML 代码如下所示:

<img src="http://chart.apis.google.com/chart?chxr=0,50,100|1,0,50&chxt=y,x&chs=900x300&cht=ls&chco=DA3B15,3072F3&chd=s:stt3rp3ts7rp2ut7uz7tt5rr5rw5rs2qr2qr2tq5rr3qp3rr2q,uqq2sp0nqnzoop3qq2tt4tr2sr2rw1rq2rr2qs3pozpoo4rp2p&chdl=With+lock|Without+lock&chg=50,20&chls=2|2&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock&chts=676767,13" width="1000" height="300" alt="FluorineFx - FactoryInstance with/without lock" />

有没有人有解决方案可以帮助正确缩放图形?

I'm using a simple Google chart to picture a benchmark:
alt text

Since most data is located between 50 and 100 I tried to make the range a bit smaller but this results in an incorrect graph.
alt text

First value of the red line starts at 72 on first graph but at 87 on the second one. The HTML code looks like the following:

<img src="http://chart.apis.google.com/chart?chxr=0,50,100|1,0,50&chxt=y,x&chs=900x300&cht=ls&chco=DA3B15,3072F3&chd=s:stt3rp3ts7rp2ut7uz7tt5rr5rw5rs2qr2qr2tq5rr3qp3rr2q,uqq2sp0nqnzoop3qq2tt4tr2sr2rw1rq2rr2qs3pozpoo4rp2p&chdl=With+lock|Without+lock&chg=50,20&chls=2|2&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock&chts=676767,13" width="1000" height="300" alt="FluorineFx - FactoryInstance with/without lock" />

Has anyone a solution that helps scaling the graph correctly?

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

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

发布评论

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

评论(1

红ご颜醉 2024-10-17 00:44:50

为了使其工作,我必须将输入数据更改为纯数据格式:

chd=t:72,73,... // char data

定义轴范围所需的范围:

chxr=0,60,100,10|1,0,50,5

指定 char 自定义缩放值:

chds=60,100

其结果是:

<img src="https://chart.googleapis.com/chart?chs=900x300&cht=ls&chd=t:72,73,73,90,71,68,90,73,72,97,71,68,88,76,74,97,76,84,96,74,74,94,70,70,94,71,78,93,71,72,89,69,70,89,69,70,88,74,69,94,71,71,90,69,68,90,71,70,89,69|75,69,69,89,72,67,85,64,69,64,84,65,65,67,90,69,69,89,73,73,92,74,70,88,72,70,88,71,78,87,70,69,88,70,71,88,69,72,90,68,65,84,67,66,66,91,71,68,89,68&chxt=y,x&chds=60,100&chxr=0,60,100,10|1,0,50,5&chbh=35&chg=10,10&chco=DA3B15,3072F3&chdl=With+lock|Without+lock&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock"/>

替代文字

To make it work I had to change the input data to plain data format to:

chd=t:72,73,... // char data

Define the required range for the axis ranges:

chxr=0,60,100,10|1,0,50,5

Specify the char custom scaling value:

chds=60,100

Which results in:

<img src="https://chart.googleapis.com/chart?chs=900x300&cht=ls&chd=t:72,73,73,90,71,68,90,73,72,97,71,68,88,76,74,97,76,84,96,74,74,94,70,70,94,71,78,93,71,72,89,69,70,89,69,70,88,74,69,94,71,71,90,69,68,90,71,70,89,69|75,69,69,89,72,67,85,64,69,64,84,65,65,67,90,69,69,89,73,73,92,74,70,88,72,70,88,71,78,87,70,69,88,70,71,88,69,72,90,68,65,84,67,66,66,91,71,68,89,68&chxt=y,x&chds=60,100&chxr=0,60,100,10|1,0,50,5&chbh=35&chg=10,10&chco=DA3B15,3072F3&chdl=With+lock|Without+lock&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock"/>

alt text

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