Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How to create vertical labels (each label in new line) like:

1998
150
pipe name

and not horizontal:

1998 150 pipe name
share|improve this question

2 Answers 2

You can use a QGIS expression in the label expression.

"Date" || '\n' || "Size" || '\n' || "name"

You can even wrap the expression over multi lines to do the same thing

"Date" || '
' || "Size" || '
' || "name"

Note the ' at the end and start of each line. The first is clearer with its intentions so I would use that.

share|improve this answer

An alternative to Nathan's excellent reply is to use the new labeling tab in QGIS 1.9 (also available in 1.8 but not from the layer properties menu. Instead go to Layer->Labels).

If you scroll down on the label settings tab you will find a Multiple Lines option, where you can specify the character to wrap the line on. This will be helpful if you are concatenating your string using something other than a newline character (as per Nathan's reply) or you have a string that is held in a single field (I often have to contend with slightly 'messy' data from other sources like this).

The other advantage of the multiple lines option is that you can specify alignment and line height too. So you could concatenate using spaces and then align centrally or to the right with a 1.5 line spacing (if that is cartigraphically appealing).

e.g. "Date" || ' ' || "Size" || ' ' || "name"

...with wrapping set to a single space plus align set to 'right' might give you something like:

     1998
      150
pipe name
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.