QGIS Error – Fix ‘Data-defined Size is Not Enabled’ When Creating Legend

errorlegendqgis

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?

Data-defined size is not enabled error

Best Answer

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 image description here

Enter your expression or use the assistant. Now you can use the "Data defined size legend".

Related Question