8

I cannot figure it out to move Labels in an QGis-Layer. I added two columns (x,y) and set these columns as Data-defined-Position in the layer-properties as descriped in some (older) threads (e.g. How does manual Label Placement in QGIS 1.9 work? or Is there a way to manually place labels in QGIS?).

The button to move the label is greyed out. I am using a shp-layer with polygones in QGis 2.14.

Is there a way to to this (without using a plugin)?

edit: Here some screenshots of the problem: enter image description here enter image description here enter image description here

vezzon
  • 559
  • 4
  • 10
  • Which button is "greyed out"? (Properties-->Labels-->Placement-->Offset-->Data defined? That one? – Jason Mar 02 '16 at 10:33
  • did you turn on editing for the layer? – Ian Turton Mar 02 '16 at 10:56
  • Editing is turned on for the layer and the buttons for rotating, moving and "Show/hide label" in the labeling toolbox are greyed out. The other button of the toolbox are eneabled.The button "Change Label" is eneabled. Selecting this button and klicking on a Label, the window "Label properties" will open, but only the field "Text" is eneabled. – vezzon Mar 02 '16 at 11:25
  • I just tried it and it worked for me.... everything you klicked plus take the option: field type... and then pick the right column. I can post screenshots too if you want.. Also i was not in the edit mode... If that is not it I don't can't reproduce the problem... but the "y" is your current selection... coordinate system trouble maybe? – Jason Mar 02 '16 at 12:07
  • Also: in the x and y columns I can not see values in your screenshot but I guess there are some, right? – Jason Mar 02 '16 at 12:10
  • No, in the x and y colums are no values. But nothing changes on adding values! – vezzon Mar 02 '16 at 12:17
  • 1
    Did you save the newly added x and y column before using the data binding x and y label coordinates? Otherwise I cannot reproduce your issue. – Jakob Mar 02 '16 at 12:21
  • No problem with null values in x and y when you start. QGIS just uses the default label position, as if there where no data binding when no value is entered. – Jakob Mar 02 '16 at 12:24
  • Yes, I have saved the added x- and y-columns before using the data binding. – vezzon Mar 02 '16 at 12:28
  • Just for the record, I am using QGIS 2.12.3-Lyon for Win7 and I also cannot get this to work. Interesting problem... – Joseph Mar 02 '16 at 15:00
  • Thanks for the problemsolving. helped much allready. I have one other issue though. i got so far that i can move Labels which works fine. but if i want to use the "Edit Label" tool everything is greyed out. i would like to turn some Labels off due to dupblicates. any ideas? printscreen1 – daverous May 06 '19 at 13:55
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – Vince May 06 '19 at 15:41

2 Answers2

7

From your screenshot I suspect that you are setting the data defined x and y to the expressions "x" and "y", rather then directly binding them to the field itself.

Make sure you use the "attribute field" submenu in the data defined popup menu and select your x and y fields from that menu, rather then using expressions.

ndawson
  • 27,620
  • 3
  • 61
  • 85
  • I got it! You are right. The mistake was, to use the name of the added column (e.g. "x") in the settings of the data defined section. You have to use the "attribute field" submenu in the data defined popup menu and select the x and y fields from that menu!!! Thank you! – vezzon Mar 03 '16 at 08:43
3

An appreciation for the answer: if the labels have rules, the button to move the label remain greyed out. Better labels without rules.

enter image description here