Bug report #21101
Legend content issue when using atlas and themes
|Affected QGIS version:||3.4.4||Regression?:||No|
|Operating System:||Windows 10||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||28919|
Here is the behavior I noticed:
When using themes and an atlas to generate automatically maps, the current selected sub item in the map will be used rather than the setting of the theme.
IE: If I have a layer with 7 classes and I want one of them to be displayed for 2 themes and all the classes for 1 other theme.
The legend will display the classes that are currently activated in the map regardless of what is displayed by the theme on the canvas.
This mean that I must set my map to match the theme of the canvas in order to display the proper categories in the legend, otherwise only one, none or all the classes for a given layer will be displayed depending on the current map theme and regardless of the canvas theme.
Thanks and have a nice day!
#3 Updated by Alexis Roy-L over 3 years ago
Giovanni Manghi wrote:
Please always test with the latest version available, now is 3.4.4. Thanks.
Bug is still present in 3.4.4
Here is how to replicate it:
1 Make a layer with categories.
2 save themes with some categories disabled
3 Make a file with the name of the theme in a field to act as the atlas
4 in the layout deactivate auto update and add the layer to the atlas, set the legend to filter visible elements
5 use the atlas field to set the canvas map theme and activate the theme option.
6 cycle through the atlas.
You will see that only the map preset will be used to determine which layer categories will be displayed in the legend.