A Diagram Legend is an element that you can add to your diagram to provide information about the colors and/or line thicknesses and styles that have been used in the current diagram, where those colors and other styles have some particular meaning. For example, it is common to have a Legend that indicates a particular color is indicative of a particular element status or version. Connectors might be colored according to whether they are of a particular type or direction. Element borders might be thicker or thinner according to some other property or condition.
Legends have additional capabilities, including the ability to auto color elements in different ways and according to different rules and filters. Legends are classified as elements and will be listed in the Browser window; however, they are not shown in contents of a Package displayed on a diagram.
The next topics detail the mechanics of setting up your Legend, but first a quick overview.
Simple Legends provide a manually configured key set that references the various styles used in the diagram. For example, an element might be manually set to fill with the color red, and the Legend can be configured to indicate that red means 'Overdue'. This is a very useful and powerful way of providing information about the conventions and styles used and the meanings that they represent. You can create and add as many Simple Legends as you need to your diagram.
An Auto Legend is one that has the 'Auto Color' checkbox ticked. This puts the Legend into a more 'active' mode, and will influence how the diagram is actually drawn without you having to make manual changes to the elements on display.
For example, it is possible to set up a Legend that will set all Requirement elements that have a Status of 'Validated' on a diagram to a specific fill color. The color will be applied automatically to the filtered element set with no manual intervention. This is a very powerful mechanism for providing a dynamic view of a diagram and exposing inner attributes, properties or statuses in real-time. This technique can be applied to element fill, element border color, element line thickness, connector line thickness and connector color.
It is important to remember that when the auto-color property is set, the change in element appearance is only dynamically applied on the Legend's diagram, and is not a permanent change. If you de-activate the Legend, all elements affected will return to their base appearance.
Stacked (Multiple) Legend
What is even more powerful is the ability to 'Stack' multiple auto-color Legends on a diagram and let Enterprise Architect dynamically color according to the union of all the different Legend conditions. For example, this approach lets you dynamically color or affect the appearance of Requirements according to Status, Components according to Phase, Use Cases according to Version, and so on. By stacking multiple Legends you have the ability to create a very rich and detailed diagram that conveys a huge amount of information in its dynamically applied styles.
Getting Started with Legends
These topics provide the necessary information for creating and configuring Legends on diagrams. Keep in mind that you can use Legends at any level, from the Simple type to the more dynamic Auto-Coloring and Stacked styles.