New answers tagged

1

To adapt the code you are using to categorize based on the expression suggested by @JGH, you actually need to create the list of unique values and QgsRendererCategory list based on the expression. Please try the code below, adapted (and 'Pythonicized') from the logic in the addCategories() method of QgsCategorizedSymbolRendererWidget class which starts at ...


4

Instead of categorizing the data by intensity, you can categorized it by a concatenation of intensity and affected_p The expression would be similar to "intensity" || ' - ' || sum("affected_p","intensity") The example below use the average instead of the sum:


7

The file bivariate_legend.py has a missing import. Open file /Users/judithheher/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/BivariateLegend/bivariate_legend.py in any editor. Add from qgis.core import Qgis to the import section. Restart QGIS and retry. The plugin will run seamlessly.


0

As commented by @YogeshChavan: The legend is only active when working in a layout view and from your comment it looks like when you used your global scene in a map frame on a layout view you were able to insert a legend to go with the layers in it.


4

As far as I know, the overall size of the legend cannot be forced, and there is no word-wrapping logic (only the labelling engine in the map supports word wrapping, the legend graphic builder is an entirely different animal).


1

For now, here is a workaround in the form of a Python script. It's quite easy to use. Just paste the script below into a new editor in the Python console, open a print layout, select a legend in the layout, select a layer in the main window Table of contents, then run the script. def invertLegendNodeOrder(updateTOC=False): open_layouts = iface....


1

You have to summarize the area by categories, otherwise your expression won't work. As per @Jakobs comment, you have to set this expression in the Legend-tab of the layers properties. The following should work: @symbol_label||' ('||sum("area","CODE_18")||' ha)' This tells QGIS to summarize the field "area" based on the ...


-2

In the main map window (ie not the layout) go to the symbology settings for the layer in question (dNBR in your case), and click in the 'Values' heading in the 'classes' section. That should allow you to order the entries ascending/descending as you wish, without changing the color ramp order. Then go back to the legend settings of the layout window and ...


2

Unfortunately, this is a known limitation, which is documented in the print widget: https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print.html Printing layers using clustering will create a client-side image of the layer in the printout. There is no current support for printing legend items for layers that are sent as a client-...


1

It seems there is a bug, or maybe intentional behavior where the print widget just sends your layer as a raster layer to the printing server. The map JSON it is sending is looking at your layer as an image. It is sending the image in base64: { "operationalLayers": [ { "type": "VectorTileLayer", "styleUrl&...


0

I could do that by right-clicking on legend item and "copy" it first. Later, I have to go to menu bar "Edit --> Paste" to get the work done.


3

An other solution from the layer style panel You can export the color map to a file, reorder the lines with a text editor and import the file again. Step Export the color map to a file (1 in the picture) Open the file, reorder the lines and save the file Open the file again (2 in the picture)


5

you can edit it manually, uncheck "Auto update" and use the arrows to reorder the values...yes, not that comfortable, but even better then flipping with MS Paint.


0

This is a known issue but there are no perfect way to solve this right now. And it is partly intended. Just set a size when Null as per https://github.com/qgis/QGIS/issues/39882#issuecomment-723669783


Top 50 recent answers are included