谷歌可视化间距

发布于 2024-09-01 13:37:28 字数 392 浏览 2 评论 0原文

我使用 Google Visualization API 制作了一张类似于下面的图表。我的问题是,在该图表的关键位置的右侧(显示低、中、高)有太多空白。我怎样才能摆脱这个空白?

替代文本
(来源:securitymonks.com

I have a chart similar to the one below using the Google Visualization API. My problem is that on the right side of where the key is for this chart(where it says low, medium, high) there is too much white space. How can I get rid of this white space?

alt text
(source: securitymonks.com)

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

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

发布评论

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

评论(2

云之铃。 2024-09-08 13:37:28

您可以使用宽度和高度百分比&选项变量中的宽度和高度值,甚至将图例推到底部作为一行。然后将选项传递给您正在绘制的图表。

var options2 = { width: 265, height: 200,
            chartArea: { left: 60, top: 20, width: "100%", height: "60%" }, 
            isStacked: true, allowHtml: true, 'legend': 'bottom', titleTextStyle: { color: 'green', fontFamily: 'Arial', fontSize: 16 }, legendTextStyle: { color: '#666666' },
            vAxis: { title: 'Liters', titleTextStyle: { color: 'blue', fontName: 'Arial', fontSize: 10 }, textStyle: { fontSize: 9} },

You can play around with width and height percentages & width and height values in options variable and even push the legend to bottom as one single line. Then pass the options to the chart you are drawing.

var options2 = { width: 265, height: 200,
            chartArea: { left: 60, top: 20, width: "100%", height: "60%" }, 
            isStacked: true, allowHtml: true, 'legend': 'bottom', titleTextStyle: { color: 'green', fontFamily: 'Arial', fontSize: 16 }, legendTextStyle: { color: '#666666' },
            vAxis: { title: 'Liters', titleTextStyle: { color: 'blue', fontName: 'Arial', fontSize: 10 }, textStyle: { fontSize: 9} },
零度℉ 2024-09-08 13:37:28

作为一种解决方法,我最终只是使图形更宽并在包含的 Div 上使用溢出:隐藏。如果有人知道 API 是否允许缩小空白区域,请告诉我。

As a kind of work around I ended up just making the graph wider and using overflow:hidden on the containing Div. If anyone knows if the API allows to make the white space smaller please let me know.

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