4

When I use the tool's assistant in order to create proportional circles, I have no problem to display its legend. We can see the legend in canvas map and therefore, it's perfect for the print composer.

However if I use the expression feature, I have no possibility to display correctly the legend. The scale is not good. You can see the figure that values in legend are completely overestimated. It seems to be a unit problem or something else.

With the tool's assistant enter image description here

With the expression feature enter image description here

8
  • I'm pretty sure this is a know issue. Check out the bug tracker page if you're interested. github.com/qgis/QGIS/issues
    – csk
    Commented Nov 21, 2019 at 16:49
  • 1
    You are assigning manually the labels. I don't know if there are a better solution, but I think that you need to manually calculate the values too. Put the scaled value and the original label for each class in the legend (Value 4.65, Label: 10; Value: 17.26, Label: 100; Value: 60, Label: 890). I would think that something like that is what the assistant does automatically. Commented Nov 21, 2019 at 22:42
  • Also, seems to me that you are using points, not milimeters. With points the size will depends of the Points Per Inch configuration of the screen or the canvas (that is not my specialty at all), but a symbology of 60mm seems to me too big for a map. Commented Nov 21, 2019 at 23:08
  • @csk Thanks for the link!
    – Bellice
    Commented Nov 22, 2019 at 10:53
  • @GabrielDeLuca Thanks for the tip, it's works! Indeed, this is not convenient to calculate manually the value for each class. I assign manually the labels because I use a scaling method that sets only the size of the symbol represented for the largest label. With the assistant, I am forced to set the values for the smallest label and the largest label. With reference to units, pt and mm are absolute units. 1pt will be always equal to ~0.35mm.
    – Bellice
    Commented Nov 22, 2019 at 10:53

1 Answer 1

1

When you use the Data-defined Size Legend you can define Manual size classes for the legend.

The Value field is the size of the symbology, and the Label field is a value label that you assign to that size.

Since you are defining an expression in the data defined size of the symbol, the size of the symbol is not the value of a field, and you need to manually evaluate the expression to know the size of the symbols that you want to include as classes.

In your example, when the value of the field 'nb_com' is 10, the exrpression returns 4.65 to the size of the symbol. So you need to write 4.65 in the 'Value' field and 10 in the 'Label' field. The same calculation applies to Value' 17.26 for the 'Label' 100, and the 'Value' 60 for the 'Label' 890.

This is a manual definition of the classes for the legend. The assistant do it automatically and you have not control about the classes defined by it.

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.