Tuesday, 7 July 2015

Change Legend Right to Left Reading in QGIS


I am a new QGIS user and i have a challenge to convert legend from right to left reading in QGIS like ArcGIS.




Answer



Workaround for creating a right-aligned legend in QGIS



Make two identical legends without borders. Make sure the legend items are in the desired order. Edit the legends as follows:


Legend one will be nothing but layer symbols.


Remove item text for all legend items. Remove the legend title.


enter image description here


Legend One looks like this: enter image description here


Legend two will be text-only.


Keep the legend title and item text labels. Choose your desired title alignment; in this example I used a right-aligned title. Add a white rectangle (or whatever color the page background will be) to cover up the layer symbols.


Legend two looks like this: enter image description here


Now place legend one to the right of legend two. Be sure to line them up perfectly. The final legend looks like this: enter image description here


Select both legends and use the Group Items button to group them together as one unit. Note that in order to edit each legend item, you will need to ungroup them. enter image description here





Options:



  • If you want a border around the entire legend, add a rectangle with transparent fill.

  • If you want the legend title aligned all the way to the right, remove the title from legend two. Add the title as a separate label item.




Update (December 2019): QGIS 3.10 has a new feature: Right-to-left arrangement for legends.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...