Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend content issue when using atlas and themes #28919

Closed
qgib opened this issue Jan 25, 2019 · 6 comments
Closed

Legend content issue when using atlas and themes #28919

qgib opened this issue Jan 25, 2019 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering

Comments

@qgib
Copy link
Contributor

qgib commented Jan 25, 2019

Author Name: Alexis Roy-L (Alexis Roy-L)
Original Redmine Issue: 21101
Affected QGIS version: 3.4.4
Redmine category:map_legend


Greetings,

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!

@qgib
Copy link
Contributor Author

qgib commented Jan 25, 2019

Author Name: Alexis Roy-L (Alexis Roy-L)


This is not an issue with the auto-update activated. But the auto-update displays too much information(basemap, etc.), which makes it more annoying to use.

@qgib
Copy link
Contributor Author

qgib commented Jan 26, 2019

Author Name: Giovanni Manghi (@gioman)


Please always test with the latest version available, now is 3.4.4. Thanks.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Jan 26, 2019

Author Name: Alexis Roy-L (Alexis Roy-L)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 28, 2019

Author Name: Giovanni Manghi (@gioman)


  • version was changed from 3.4.0 to 3.4.4
  • status_id was changed from Feedback to Open

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering labels May 25, 2019
@klakar
Copy link

klakar commented Aug 19, 2019

Probably the same problem:

When creating themes with different styles and adding several map items to a layout. The legends does not follow the map theme. Even if the correct map is set as source for the legend.
inflyttning
In the picture above is looks ok, but the interval for the colors are different between the maps.
There's no way to create a product with the correct legend from layout. It's possible to show it on screen, if you add the legend with the correct theme shown in the canvas. But as soon as you move any legend, print or make an export. All legends is reset to follow the current theme in the canvas.

nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Apr 2, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes qgis#27542, qgis#24694, qgis#28919, qgis#28925

Fix sponsored by the Victorian Planning Authority
nyalldawson added a commit that referenced this issue Apr 3, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes #27542, #24694, #28919, #28925

Fix sponsored by the Victorian Planning Authority
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Apr 5, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes qgis#27542, qgis#24694, qgis#28919, qgis#28925

Fix sponsored by the Victorian Planning Authority

(cherry picked from commit d40114c)
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Apr 5, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes qgis#27542, qgis#24694, qgis#28919, qgis#28925

Fix sponsored by the Victorian Planning Authority

(cherry picked from commit d40114c)
nyalldawson added a commit that referenced this issue Apr 6, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes #27542, #24694, #28919, #28925

Fix sponsored by the Victorian Planning Authority

(cherry picked from commit d40114c)
nyalldawson added a commit that referenced this issue Apr 6, 2020
…cular

theme, then correctly follow that same theme's styling when rendering
the legend

Fixes layout legends always render using the canvas' visible theme styling,
instead of that of the linked map.

Fixes #27542, #24694, #28919, #28925

Fix sponsored by the Victorian Planning Authority

(cherry picked from commit d40114c)
@bakkerss
Copy link

bakkerss commented May 31, 2022

I experienced the same problem but found a workaround which probably explains the issue.

In my project I have a rule based symbology. As the rules are quit complex I copied the labels and changes just a small part of the filter formulas. When I create the atlas the legend is not only displaying the label in the atlas but also all the copied labels which are outside of the atlas. When I delete the copied lables and recreate them all manually the newly created lables do not appear on the atlas anymore.
So I asume the issue is caused by copying lables. Perhaps these copied lables are stored with the same key field which is used when displaying the lables in the legend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Map and Legend Related to map or legend rendering
Projects
None yet
Development

No branches or pull requests

4 participants