Overview
Legends provide contextual information about the chart or map they are connected to. They can be used to display details about color categories, continuous colors, symbol sizes, and spike heights, making it easier for users to interpret colors and dimensions in the visualization.
You can add a Legend element to your visualization by dragging one onto the canvas from the Insert dropdown in the Toolbar. Alternatively, click the Legend icon that appears when hovering on an empty section.
Legends can be configured by selecting an existing legend element and using the options available in the Legend tab in the right panel. These options are detailed below.
In this map of U.K. electoral results in 2024, categorical colors are displayed in the initial legend, and continuous color legends are displayed when party-specific vote shares are selected.
Setup
Under the Legend tab, in the Setup section, you can configure the following options:
- Name: Enter the legend element's name to identify it in the Layers tab and on the canvas.
- Connected Element: Choose a chart or map to supply information to the legend.
- Legend Type: Select from "Color", "Symbol Size", and "Spike Height." Certain options will be unavailable depending on the type of chart or map selected as the Connected Element.
- Margin: Specify the space around the legend element in pixels.
- Alignment: Align the legend element to the left, center, or right.
- Gap: Set the horizontal gap between legend items and the vertical gap between legend rows.
Legend Types
While setting up a legend, specify the type of legend you want to display. The following options are available:
Color: Two types of color legends can be displayed, depending on whether the connected chart or map is assigning colors in a categorical or continuous way. When a text field is used as the chart or map's Color Field, colors are assigned categorically, and the legend will display each color alongside its corresponding category name. When a number, currency, percent, or measurement field is used as the Color Field, the legend will display continuous colors with labeled ticks to indicate key values. Continuous colors can be configured with specific domains and color scales; for more information, view the Colors page.
Symbol Size: For symbol maps and scatterplot charts where symbols can be assigned a dynamic size, legends can display a range of symbols, each alongside numeric labels indicating their corresponding sizes.
Spike Height: For spike maps, legends can display a range of spike symbols, each paired with numeric labels indicating their corresponding heights.
This map of U.S. airport traffic includes two legends: one showing symbol sizes, and the other showing how a continuous color ramp is assigned to each symbol.