How do I customize the order of my legend?
There are three ways to re-order legend entries, depending on how they were added.
Change the order of the fields
If you added legend entries using the Color by tool in the Basic Editor, follow these steps to change the order:
Click the menu icon to bring up the project settings
Select Fields from the sidebar on the left
Select the same field you selected in the Color by tool—it's settings panel will open up
Drag and drop field values to change their order (see below gif)
Click Save at the bottom of the field settings to save your changes, then reload the page
Change the order of your customized decoration styles
When you create a customized styling rule for each legend entry, you can drag them in the right order after. Here's how to do this:
If applicable, first set the Color by tool in the Basic Editor back to "select a field" to turn it off.
Use the element decoration builder (click Decorate Elements in the Basic Editor)to recreate each color coding rule individually. Instead of using Color by to automatically color by Type, you would instead create a separate, custom decoration for each possible value in the Type field. Be sure to fill out the Label for legend box at the bottom of the decoration builder to make sure rules are added to the legend!
After creating all your custom decorations, return to the Advanced Editor and locate the codes generated by Kumu for your custom decorations, cut and past the codes to re-arrange the legend entries the way you want them to appear on your map.
Change the order in the Advanced Editor
It's also possible to customize the order of Color by color-coded legend entries, using the Advanced Editor:
In the code above, you can replace Element Type
with the name of the field you want to color by, and replace Education
, Finance
, and Agriculture
with actual values from your dataset. Replace red
, blue
, and green
with named colors or hex color codes.
The order of your values dictates how the legend appears. Simply rearrange the values in the order you want your legend to appear on the map.
You can add as many color + value combinations as you want to the comma-separated list inside your categorize()
parentheses.
Last updated