---
title: "Chart legend control in Vista | Oplema"
description: "Place a chart legend anywhere on a Vista dashboard to explain what each color means. Connect it to a filter, and selecting a value filters the data too."
url: "https://oplema.com/docs/vista/controls/legend"
updated: "2026-11-04"
---

# Legend

Legend shows a chart's colors as a separate visual you can place anywhere on the page. Connect it to a filter and selecting a value filters the data too.

## Filter a stacked chart from its legend

The legend on the left lists the drinks of the stacked chart on the right, and it's connected to a filter on Drink, so selecting a value narrows the data as well.

Result
| Drink | Store | Cups |
| --- | --- | --- |
| Tea | Oslo | 14 |
| Tea | Rome | 9 |
| Tea | Lima | 6 |
| Latte | Oslo | 21 |
| Latte | Rome | 28 |
| Latte | Lima | 12 |
| Mocha | Oslo | 8 |
| Mocha | Rome | 11 |

1. Select Tea in the legend. The chart now shows only Tea.
2. Select All values to bring back every drink.
3. In Properties, open the Design tab and change Arrangement from `List` to `Horizontal`.

## When to use

Use Legend when several charts share the same colors or a chart's own legend takes too much room. Hide the in-chart legend in Design so the names don't appear twice.

## Inputs

1 port

**Filter Optional**

Accepts: References.

Accepts one connection on this port.

## Settings

A legend connects to charts on the same page in its Data tab, under Charts. Under Filter you can connect an existing Vista Filters definition. Disconnecting keeps the filter and its selection. Design sets Arrangement, Style and Search.

**Charts**

Charts whose colors this legend explains. Adding charts here doesn't widen what a filter applies to.

24 more settings

**Arrangement**

Lays out legend items as a list, in a horizontal row or in a grid.

Default: `List`

Options: List, Horizontal, Grid.

**Order**

Lists items in encoding order or alphabetically.

Default: `Encoding order`

Options: Encoding order, Alphabetical.

**Style**

Shows the values as a list or buttons.

Default: `List`

Options: List, Buttons.

**Search**

Shows or hides the search box, or lets the control decide automatically.

Default: `Automatic`

Options: Automatic, Show, Hide.

**Include All option**

Adds an All choice to the values.

Default: `true`

**Show “All” button**

Shows or hides a separate All button that removes the filter.

Default: `true`

**Text for “All” (optional)**

Leave empty for an automatic label.

**Decimal places**

How many digits appear after the decimal point.

Default: `2`

**Show title**

Shows or hides the legend's title.

Default: `true`

**Title**

Title text shown on the legend.

**Title size (px)**

Size of the legend title, in pixels.

Default: `14`

**Value size (px)**

Size of the value labels, in pixels.

Default: `12`

**Alignment**

Aligns legend labels left, center or right.

Default: `Left`

Options: Left, Center, Right.

**Wrap labels**

Lets long labels wrap onto more lines.

Default: `true`

**Swatch size (px)**

Size of each color swatch, in pixels.

Default: `12`

**Spacing (px)**

Space between legend items, in pixels.

Default: `8`

**Text color**

Color of the value labels.

**Background**

Fill color of each option.

**Border**

Border color of each option.

**Selected text**

Text color of a selected option.

**Selected background**

Fill color of a selected option.

**Selected border**

Border color of a selected option.

**Corner radius (px)**

Corner radius in whole logical pixels.

Default: `0`

**Border width (px)**

Border width in whole logical pixels.

Default: `0`

## Legend FAQs

**Is Legend required to filter by color?**

No. A Filter control works too. Legend is useful when you want colors and filtering in one place.

**Can one legend serve several charts?**

Yes, when their colors are compatible. Add them under Charts in the Data tab.

**Does disconnecting a legend remove the filter?**

No. Disconnecting keeps the filter and its selection.

### Chart your data. Build it in Vista.

Vista opens in your browser, with no account.

[Open Vista](https://oplema.com/editor?path=%2F%3Fopen%3Dvista) [About Vista](https://oplema.com/vista)
