I would like to make a legend to a map in qGIS 3.18 using proportional symbology based on an integer field. When I go to Layer Properties -> Symbology -> Advanced -> Data-defined Size Legend, I get an error message saying "Data-defined size is not enabled!". Would anyone have any ideas what could be the reason?
2 Answers
The reason is that you are not using a data defined size. You are using a graduated size renderer.
To use the data defined size legend as you show in your image, choose another option than graduated size, e.g. graduated color, single symbol, categorized, ... Then click on symbol and on the small box right of "size" option:
Enter your expression or use the assistant. Now you can use the "Data defined size legend".
-
Thank you, it seems I didn't understand what "data defined size" means. It works perfectly now!– PaulCommented Apr 1, 2021 at 17:51
- Set the Layer Styling to Graduated
- Select the real or integer field in Value to scale the symbol
- Use the expression editor next to Value to modify the size (scale, offset, etc.)
The legend should update on both the map legend and the printable map layout legend.
The option you refer to does not work on Mac under 3.18 either. No reference to enable data-defined size was found in Settings->Advanced or elsewhere. It would be good to now what this is meant to do, but it may not be necessary if the solution above is effective for you.
-
Thanks, but I have already set these options. What I am unable to do is something like this: i.sstatic.net/phoNc.png– PaulCommented Apr 1, 2021 at 17:08