如何从 Google 条形图(又名图表 API)中删除两个轴
I can't find in the Chart API the way to remove any axis from a bar chart. For instance:
cht=bvg
chs=410x150
chd=s:StackOverflow
How to remove the gray x and y axis?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请尝试附加
&chxt=x,y&chxs=0,000000,10,0,,000000|1,000000,10,0,,000000&chxl=0: ||1:|
Please try appending
&chxt=x,y&chxs=0,000000,10,0,,000000|1,000000,10,0,,000000&chxl=0:||1:|
我发现的只是这个技巧:覆盖它们带有白线,它可以工作
...但有什么“更干净”的方法吗?
All I found is this trick: cover them with a white line and it works
...but any "cleaner" way?
(基于 Alexander Farber 的答案,但有一些小的改进)
您可以添加
解释:
要显示哪个轴。尽管 x 轴和 y 轴显示为默认值,但我们仍然需要指定它们才能使用 chxs 应用样式。
样式为两个轴,由管道分隔。用逗号分隔,我们有:
0
= 第一个 (x),1
= 第二个 (y)0
将隐藏标签,因此我们不需要使用 chxl0
没问题。_
将隐藏https:// 的更多信息Developers.google.com/chart/image/docs/chart_params#axis_label_styles
(based on Alexander Farber's answer, but with some minor improvements)
You can add
Explanation:
Which axis to show. Even though axis x and y are shown as default, we still need to specify those to be able to apply styling with chxs.
Styling for the two axis, separated by pipe. Separated by comma, we have:
0
= first (x),1
= second (y)0
will hide the labels, and thus we don't need to set empty labels with chxl0
is fine._
will hide bothMore info at https://developers.google.com/chart/image/docs/chart_params#axis_label_styles