Google图表上的图例如何包装 [英] How the legends on Google charts can be wrapped
本文介绍了Google图表上的图例如何包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果超过容器面积,我需要Google图表的图例才能自动包装(新行)。
我不想滚动按钮,因为它不够方便。
有了可用的自定义选项,似乎无法做到。
任何其他方式?
I need the legends of Google chart to get wrapped (comes in new line) automatically if it exceeds container area. I don't want scroll button as it is not enough convenient. With available customization options, seems it cannot be done. Any other way?
推荐答案
对图例使用maxLines属性。
ie。:
Use the maxLines property for the legend. i.e.:
options.legend = {position: 'top', maxLines: 5};
请注意,这个无文档的属性仅在图例位于顶部且有足够的垂直空间以渲染图表和多行图例。
Note that this undocumented property only works if the legend is positioned at the top and there is enough vertical space to render both the chart and multi-line legend.
这篇关于Google图表上的图例如何包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文