如何从 Google 的 Visualization API 生成的条形图中删除 x 轴? [英] How do you remove the x-axis from a bar chart produced by Google's Visualization API?
问题描述
参考此处显示的图表类型:http://code.google.com/apis/visualization/documentation/gallery/barchart.html
Referring to the kind of chart shown here: http://code.google.com/apis/visualization/documentation/gallery/barchart.html
似乎没有简单的开关,将轴颜色更改为白色(在白色背景上)似乎没有任何作用.我什至尝试使用 jquery 隐藏 api 输出产生的选择器,但没有骰子.
There doesn't seem to be a simple switch, and changing the axis color to white (on a white background) didn't seem to do anything. I even tried jquery to hide the selectors produced by the api output but no dice.
推荐答案
您可以将 hAxis.textPosition
设置为 'none
'
You can set hAxis.textPosition
to the value of 'none
'
例如:
var options = {
hAxis: { textPosition: 'none' },
};
chart.draw(data, options);
请参阅 https://developers.google.com/chart/interactive/docs/gallery/barchart#Configuration_Options
这篇关于如何从 Google 的 Visualization API 生成的条形图中删除 x 轴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!