How the legends on Google charts can be wrapped

2019-03-26 20:06发布

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?

标签: charts
1条回答
Lonely孤独者°
2楼-- · 2019-03-26 20:37

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.

查看更多
登录 后发表回答