qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.37k stars 2.98k forks source link

No legend text from polygon feature attributes #53196

Open Rupicolus89 opened 1 year ago

Rupicolus89 commented 1 year ago

What is the bug or the crash?

I created shapefiles containing polygon features, using the Digitize splines plugin. Such shapefile contains two polygon features. These features have two text attributes named:

opis and konc

The symbology (polygon with line border and color fill) is shown correctly in the legend, but I cannot find a way to show the text from attribute opis in a map legend in print layout, next to the according symbol to describe it. I typed "opis" with hyphens into the expression string builder for the legend item. In the preview (see screenshot) the correct text: TEST is visible, but never in the legend. I have made cca 60 such shapefiles, like the one in the sample zip file, for cca 60 different maps, but now I cannot auto-create legends for them. :-(

When I turn off automatic update of legend items, the text can be typed into the legend items, and it is shown corectly. I also use a WMS layer, point layers having coordinates from delimited text and another shapefile with one polygon feature, shown in the legend correctly. Snímka Snímka2 Sample.zip

Steps to reproduce the issue

New project Create shapefile with polygon features using Digitize splines plugin, each feature with two attributes konc and opis containing text strings. set symbology for the polygons: color fill, border line with text labels on it text is taken from the first attribute konc create print layout. put map into layout, showing these new features with symbology put legend into layout check: auto-update legend items check: only show items inside current map type the attribute name "opis" with hyphens into Expression string builder - the preview shows TEST correctly. legend will only show the filled rectangle symbols, not the text from opis which is needed to describe the polygon feature.

Versions

3.30.2 3.30.0 3.28.2

Supported QGIS version

New profile

Additional context

No response

roya0045 commented 1 year ago

Not a bug, if you want this to work collect all values based on the filter and pick one.