在Google Charts中格式化图例和坐标轴 [英] Formatting legend and axis in Google Charts

查看:110
本文介绍了在Google Charts中格式化图例和坐标轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Google图表新手,我无法通过图表周围的文本获得好结果。



这就是我的图表:





正如你所看到的,它确实会削减水平轴和传奇,所以最终的结果并不如它可能。有没有办法解决这个问题?我一直在阅读官方文档和一些帖子,但我还没有找到方式来做到这一点。



回顾:我们如何修改图例或轴文本以便它们完全可见?

解决方案

经过一段时间的实验,我敢说选择图表或轴上的单词可以显示多少部分是不可能的。

然而,您可以玩他们的尺寸和位置,以便获得更多或更少的 - 我们正在寻找的东西。
这是可以做到的:

 图例:{position:'top',textStyle:{fontSize:14 }} 

我也使图像变大一点,所以它适合x轴问题(也可以选择缩小文本)。

因此,您可以这样做:


I'm new with Google Charts and I am not able to obtain a fine result with the texts surrounding the graph.

This is how my chart looks:

As you can see, it does cut both Horizontal-Axis and Legends, so the final result is not as good as It could be. Is there a way to solve this? I've been reading the official documentation and some posts from here, but I haven't found the way to do this.

Recap: How do we modify the legend or the axis texts so they are fully visible?

解决方案

After some time experimenting, I daresay it is not posible to choose how much part of the words on legend or axis you can show.

However, you can play with their sizes and position so you get -more or less- what we were looking for. This is what can be done:

legend: {position: 'top', textStyle: {fontSize: 14}}

I've also made the image a little bit bigger so it fits the x-axis without problems (There was also the option of making its text smaller).

So doing this, this is what you get:

这篇关于在Google Charts中格式化图例和坐标轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆