5

I need to place symbols (point layer) with abbreviations from a attribute table. I solved that with "font marker" and data defined override as you can see in the screenshot below. The result in the map is exactly what I need, but the legend isn't. In the legend, every type of symbol got a "A" instead the abbreviation from the classification.

How can I solve that? Or is there a other way to get the same result but with a useful legend?

enter image description here

1 Answer 1

5

You can achieve this by setting the layer's style not to Single Symbol, but to Categorized, based on the Value that comes from the field in your attribute table containing the abbreviations. Then click on the symbol and set data driven override there, see:

enter image description here

Now open a new layout, add a map and legend. In the legend's Item properties, expand Legend items and uncheck the box Auto update. You now have an identical, default A font marker symbol for each entry, but color and legend text are already adapted to each item:

enter image description here

To adapt the symbol, you must manually change it: double click on the first one, check the box Custom Symbol, and click below on the symbol: enter image description here

In the opening dialog, select Font Marker and manually insert the character you want to display. Data driven override based on the attribute value does not work here (the attributes are not available):

enter image description here

3
  • That's a way, but I don't want to set it up manually since I have to do that with about 200 abbreviations. They also could change so I need a "dynamic" solution.
    – MartinMap
    Commented Oct 3, 2021 at 9:40
  • Yes, the solution is not ideal, indeed, especially for larger data sets.
    – Babel
    Commented Oct 3, 2021 at 9:43
  • 2
    Maybe in the layer styling panel using the Advanced option / Match to saved symbols or Match to symbols from file… could help?
    – Babel
    Commented Oct 3, 2021 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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