开发者

Google charts - when Y range is changed, graph doesn't scale correctly

开发者 https://www.devze.com 2023-02-03 00:45 出处:网络
I\'m using a simple Google chart to开发者_如何学C picture a benchmark: 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.

I'm using a simple Google chart to开发者_如何学C picture a benchmark:

Google charts - when Y range is changed, graph doesn't scale correctly

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.

Google charts - when Y range is changed, graph doesn't scale correctly

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?


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&amp;cht=ls&amp;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&amp;chxt=y,x&chds=60,100&amp;chxr=0,60,100,10|1,0,50,5&amp;chbh=35&chg=10,10&chco=DA3B15,3072F3&chdl=With+lock|Without+lock&chtt=FluorineFx+-+FactoryInstance+with%2Fwithout+lock"/>

Google charts - when Y range is changed, graph doesn't scale correctly

0

精彩评论

暂无评论...
验证码 换一张
取 消