3

I need to rotate only one label from three seen below

enter image description here

I found some solutions here:

How to rotate labels by the same angle as the map in the composer?

QGIS Labels Rotation

and also here:

Using Trigonometry To Place And Orientate Labels

But it looks like they are referred for all labels belonging to the given layer. I just want to set the condition for for rotating one of them.

My expression could look like this:

 CASE
  WHEN "fid" = 18 then rotation 'degrees 45'
 End

but QGIS says, that my expression is invalid.

Is anyone able to help?

Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
Geographos
  • 4,087
  • 2
  • 27
  • 88

1 Answers1

4

Rotation accepts int, double or string(including number) value.

CASE
  WHEN "fid" = 18 THEN 45 
  WHEN "fid" = 28 THEN '45'
  WHEN "fid" = 38 THEN 45.0
END
Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389