QGIS – How to Use Rule Based Colored Background for Labeling in QGIS

colorcolor ramplabelingqgisrule-based

I am a newbie working on QGIS 3.6 / Windows 10. I need to label a polygon layer which is categorised by colour.
(pls refer to attached pic as a graphical reference)

enter image description here

The labels need to have a background which is also categorised by colour (red, orange, yellow and white) according to values in the attribute table of the shapefile.

My understanding is that the map as pictured has been created with an older version of ArcView…

Is it even possible to achieve something similar in QGIS?

Best Answer

The easiest way is to simply use the @symbol_color variable in the label background expression.

This ensures whatever color your symbols are, your labels are automatically updated, without having to set a seperate CASE statement for the labels:

enter image description here enter image description here enter image description here

Related Question