Google 图表标题未对齐
这验证了正常 http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,x,y&chds=0,8&chxr=2,0,8| 0,0,3&chxl=0:|0|1|2|1:|悬停%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5,2.5&chtt=此处+is+your+chart,+as+requested&chdl=values&chdlp=t&chd=t:4|6|8&chof=validate
如果我们删除尾随的 8&chof=validate
请求验证,剩下
http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,x,y&chds=0,8&chxr =2,0,8|0,0,3&chxl=0:|0|1|2|1:|悬停%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5 ,2.5&chtt=Here+is+your+chart,+as+requested&chdl=values&chdlp=t&chd=t:4|6|8
当我们查看它时,我们看到文本从图像左侧的某处开始。
有什么想法吗?
答:我的 chxp(x 轴位置)参数错误。
这是可行的(尽管我可能想进一步缩进第二个轴)&chxp=1,0|2,0
This validates ok http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,x,y&chds=0,8&chxr=2,0,8|0,0,3&chxl=0:|0|1|2|1:|Hover%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5,2.5&chtt=Here+is+your+chart,+as+requested&chdl=values&chdlp=t&chd=t:4|6|8&chof=validate
if we remove the trailing 8&chof=validate
which requests validation, that leaves
http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,x,y&chds=0,8&chxr=2,0,8|0,0,3&chxl=0:|0|1|2|1:|Hover%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5,2.5&chtt=Here+is+your+chart,+as+requested&chdl=values&chdlp=t&chd=t:4|6|8
and when we look at it we see that the text starts somewhere off the left of the image.
Any ideas?
Answer: my chxp
(x-axis position) parameter was wrong.
this works (although I might want to indent that second axis more) &chxp=1,0|2,0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么你有 &chxt=x,x,y
这不应该是 &chxt=x,y 吗?
我试过了,看起来不错:
http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,y&chds=0,8&chxr=2,0,8|0,0,3& ;chxl=0:|0|1|2|1:|悬停%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5,2.5&chtt=这里+是+你的+图表,+as+请求&chdl=值&chdlp=t&chd=t:4|6|8
Why do you have &chxt=x,x,y
Shouldn't this be &chxt=x,y ?
I've tried this, looks okay:
http://chart.apis.google.com/chart?cht=bvg&chs=600x500&chxt=x,y&chds=0,8&chxr=2,0,8|0,0,3&chxl=0:|0|1|2|1:|Hover%20cursor%20over%20day%20number%20for%20calendar%20date&chxp=0,0.5,1.5,2.5&chtt=Here+is+your+chart,+as+requested&chdl=values&chdlp=t&chd=t:4|6|8