33

This question was posted in 2011, and someone has said that QGIS now allows multiple lines for legend entries, but no one mentioned how to do this. I am running wein 2.8.1 and I cannot figure out how to get my legend entry on multiple lines other than manually using text.

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
T.O.6
  • 947
  • 2
  • 10
  • 16

1 Answers1

61

In QGIS 2.8 Composer, there's a Wrap text on option in the Item properties tab when you add a legend which lets you enter a character where you want the new line to start. What I normally do is use the * character in the layer's name for where I want the new line. Then input the * into the Wrap text option.

(I'm using QGIS 2.8.2-Wien):

Layer names

Wrap text options

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Joseph
  • 75,746
  • 7
  • 171
  • 282
  • 7
    Is there an automatic way to do this? I am thinking about taking character count as consideration to wrap labels. sometimes you have hundreds of classes to list in a legend, which makes this approach rather unhandy – hilpers Feb 27 '17 at 09:17
  • 1
    @hilpers - I'm sure you can but it's best to ask this as a new question as there are probably others who have found a method you're looking for :) – Joseph Feb 28 '17 at 12:56
  • 2
    You can also change the layer display name in the legend settings of the layout to avoid renaming them in the layer panel. – leak_my_brain Jun 13 '18 at 21:31
  • For automation, look at this answer and my comment: https://gis.stackexchange.com/a/449443/203521 – Beni Jan 13 '23 at 10:37