Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto wrap legend text based on character count #25172

Open
qgib opened this issue Oct 13, 2017 · 2 comments
Open

Auto wrap legend text based on character count #25172

qgib opened this issue Oct 13, 2017 · 2 comments
Labels
Feature Request Map and Legend Related to map or legend rendering

Comments

@qgib
Copy link
Contributor

qgib commented Oct 13, 2017

Author Name: Hannes Ledegen (Hannes Ledegen)
Original Redmine Issue: 17274

Redmine category:map_legend


In QGIS 2.18 there is an option to wrap text based on a certain character. There is no option to access expression builder or make the text wrap after a certain number of characters.

Ideally there would be an option to auto wrap text based on the size of the legend box.
https://gis.stackexchange.com/questions/253295/auto-wrap-legend-text-based-on-character-count/253397?noredirect=1#comment408336_253397

@qgib
Copy link
Contributor Author

qgib commented Oct 13, 2017

Author Name: Harrissou Santanna (@DelazJ)


  • description was changed from In QGIS 2.18 there is an option to wrap text based on a certain character. There is no option to access expression builder or make the text wrap after a certain number of characters.

Ideally there would be an option to auto wrap text based on the size of the legend box.
https://gis.stackexchange.com/questions/253295/auto-wrap-legend-text-based-on-character-count/253397?noredirect=1#comment408336_253397

OSGeo mantra: willnotspam to In QGIS 2.18 there is an option to wrap text based on a certain character. There is no option to access expression builder or make the text wrap after a certain number of characters.

Ideally there would be an option to auto wrap text based on the size of the legend box.
https://gis.stackexchange.com/questions/253295/auto-wrap-legend-text-based-on-character-count/253397?noredirect=1#comment408336_253397

@GIuSeless
Copy link

GIuSeless commented Mar 27, 2024

For 3.34 Prizren: In Legend, Item properties tab, click on your troublesome layer and hit the expression button below
Screenshot 2024-03-27 121546

Add the expression: wordwrap(@symbol_label , 30)
30 being the number of characters you want each line to wrap on, so change it to whatever you need

Screenshot 2024-03-27 122213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Map and Legend Related to map or legend rendering
Projects
None yet
Development

No branches or pull requests

2 participants