A Legend element on a diagram provides a visual key to the colors and line thicknesses you have used to identify elements and/or connectors that have particular meaning. The Legend can reflect a simple, manually-applied convention such as all elements concerned with a management system being shaded in blue, or all outgoing connectors colored red. However, the Auto-Color Legends can also automatically apply the style to elements or connectors having a chosen property, such as a specific phase, stereotype or type.
The Legend lists the element appearance conventions first, and the connector appearance conventions underneath.
You work on a Legend element in two stages: first create and define the Legend element itself, then define the appearance styles as displayed on the diagram.
Drag the Diagram Legend icon () from the Common page of the Toolbox onto the diagram
Click the 'New Diagram Legend' icon () on the UML Elements toolbar
In many cases a single Legend will be sufficient to cover the styles and their meanings within the current diagram. In some situations though, it is much more interesting and powerful to use multiple Legends, especially if the Legends are Auto-Coloring. Situations where multiple Legends are useful include:
- If you want to use more than one automatically-applied style (Stacked Legends)
- If you have used several manually-applied styles, and you want to identify them in small groups
- Where the diagram is large, and you want to reproduce the same key where it can be referred to in different sections of the diagram
Because a single Legend is limited to a single filter per element type (or all types), such as a range of Status values for Requirements, multiple Legends are a good way of addressing different filters on different element types. A second Legend, for example, might indicate that all Components are colored according to a Version or Phase number.
You can have conditions that operate on different properties, by defining those conditions in separate Legend elements. However, check that the conventions in the two Legends operate on different display characteristics; for example, one Legend setting Class fill color whilst the other sets Class border width. They cannot both act on the same property, such as Class fill color. If they do, the most recently-created Legend (or the one with the highest Z-order) over-rides the previous Legend.