2

I have the situation as you see below:

enter image description here

I have the buffers 50m, which have a green color. Unfortunately in the styling in the panel, they appear as boxes. When I used the point pattern fill in order to ger rounds there, I completed another pattern on my map.

How can I make the fill round in my Layers section instead without changing the general shape on my map?

2
  • You can change the shape of legend patch in a layout but I don't think you can do it in the Layer panel
    – J.R
    Apr 8, 2022 at 14:57
  • A workaround could be to add a centroid fill to your buffer, you still get a square legend but it will have a circle added (the obvious downside is that you will also get a dot displayed on your map...)
    – J.R
    Apr 9, 2022 at 8:01

4 Answers 4

3
+25

In my example, I have a red diamond with a green buffer and the buffer appears as a green circle in the layer panel.

example

There is two different symbols on this layer. The one at the bottom is the buffer itself, a simple fill with the color you want (green here). buffer

The filling color is transparent so it's not visible in the layer panel but in the data defined rules, I set this rule :

if( "id" is null, '#0ffc41','#0efc41')

Replace "id" with a random field of your choice.

This allows me to set a green color code is any case possible (there might be a better way to set this). But since the color picked earlier is transparent, the symbol appears as transparent but the rule then apply a green color to the buffer.

Then, to have a green dot symbol :

enter image description here

I set a centroid filling with the symbol of my choice, and to make it green on the layer panel and transparent on the map, I use the same technique as before but in reverse. The symbol color is set to green but in the data defined rules I set a transparent color for all the cases possible.

if( "id" is null, '#00000000','#00000000')
3
  • Very creative workaround! I hope eventually there will be the same editing options for the symbols in the Layers Panel as there are for the Legend in the Print Layout, but this is a great solution in the meantime. I can add that the field name in the if needn't even exist (but using $id instead of "id" did not work).
    – Matt
    Apr 12, 2022 at 11:48
  • Unfortunately, it didn't work as I still get the radius of my buffer gone. Thanks for your effort anyway.
    – Geographos
    Apr 19, 2022 at 10:43
  • Did you set up the two symbols for your buffer ? One for the map and one for the symbol.
    – Mr_Yum
    Apr 19, 2022 at 14:03
2

Add a copy of the layer with point symbology for the legend, but to hide this on the map, make the layer invisible, keeping instead the polygon layer for the map. So in the legend, you can only keep the point symbology, on the map only the buffer/polygon symbols.

  1. Duplicate the layer.

  2. In the layer styling panel, click on Symbol and change fill style from Simple Fill to Centroid Fill.

  3. Set Opacity of the layer to 0 % (or uncheck visibility of the layer in the Layers panel): expand layer rendering at the bottom of the Layer styling panel.

enter image description here

2
  • Centroid fill still brings me back to the position where I was at the very beginning. I need something, which will appear as the circle but will keep the radius defined - 50m on the map.
    – Geographos
    Apr 14, 2022 at 8:34
  • Yes, you'll get that: initial layer keeps the radius (buffer), duplicated layer the dots in the legend. Or did I completely misunderstand your question?
    – Babel
    Apr 14, 2022 at 11:48
0

You can use this tool and set a custom icon: https://yoannqdq.github.io/qgis-layer-tree-icons/ - But I think it would only work for the root level - so your classification icons wont work unfortunately.

1
  • That could be good, but I can't find circles there.
    – Geographos
    Apr 14, 2022 at 8:20
-1

You can use a legend patch (a circle)! https://m.youtube.com/watch?v=rb3EZSs9q4w

3
  • It refers rather to a print composer. I need it in the main QGIS panel
    – Geographos
    Apr 8, 2022 at 15:01
  • Perhaps you can do it with geometry generator as a workaroud? But not sure it will fit your needs!
    – katagena
    Apr 8, 2022 at 15:06
  • In the legend expanded dropdown I need to have circles instead of boxes, but shapes on the map must remain the same.
    – Geographos
    Apr 8, 2022 at 15:09

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.