Bug report #19096

Applying a data defined size to a categorized layer hides its category symbol in the layers panel and legend

Added by Harrissou Santanna over 2 years ago. Updated over 2 years ago.

Status:Closed
Priority:High
Assignee:Alessandro Pasotti
Category:Map Legend
Affected QGIS version:3.1(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:Yes Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:26926

Description

The aim is to obtain the Multivariate example screenshot at https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/vector_properties.html#proportional-symbol-and-multivariate-analysis and as far as i can say, when the data defined is applied to the symbol size, categories symbols are vanished. They are still applied in the map canvas but not shown in layer properties --> Symbology page, neither in layers panel nor in the layout legend.

If not clear, step by step (and i think i've narrowed the source of the issue while reporting):
- Apply a categorized symbology on a point layer
- Then, click on the Change... button to configure the default symbol of the categories
- While At the marker level, use the data defined widget next to the size property:

  • if you select an existing field or enter an expression, it works well:you get size scaling and categories are shown
  • if you use the assistant entry, things work well if and only if (afaics) "size when null" is different from 0. In that case, scaling is done but categories symbols are cleared. Actually it turns out that the category symbol is based on the null size, given that the symbol is updated in the layer tree as you play with the value applied to null features. This does not make sense to me as null values are particular one you may want to treat differently (not show them) and it should instead, in case we really need to have sized symbols for categories, use the overridden value of the property (in this case, the grayed value of size near the DD button)

Associated revisions

Revision 9fc87aab
Added by Alessandro Pasotti over 2 years ago

[bugfix] Clear all DD props before creating symbol preview

Fixes #19096 - Applying a data defined size to a categorized layer hides its category symbol in the layers panel and legend

History

#1 Updated by Alessandro Pasotti over 2 years ago

  • Assignee set to Alessandro Pasotti

#2 Updated by Alessandro Pasotti over 2 years ago

The issue here is not that the symbol is hidden, it is that the symbol in the preview is too small to be seen.
I'm looking at it but it does not seem trivial fix because the symbol preview takes the size from the expression and the calculation produce a 0 size, that is the default when NULL.

Here is short video showing the issue: http://www.itopen.it/bulk/bug_19096.gif

#3 Updated by Alessandro Pasotti over 2 years ago

  • Pull Request or Patch supplied changed from No to Yes
  • Status changed from Open to In Progress

#4 Updated by Anonymous over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

Also available in: Atom PDF