How to Wrap Legends on Google Charts

I need the Google chart legends to be automatically packed (appear on a new line) if they exceed the container area. I do not need a scroll button, as this is not convenient enough. With the settings available, this seems impossible. Any other way?

+7
source share
1 answer

Use the maxLines property for the legend. i.e:.

options.legend = {position: 'top', maxLines: 5}; 

Please note that this undocumented property only works if the legend is located at the top and there is enough vertical space to display the graph and multi-line legend.

+20
source

All Articles