2022-05-26 23:06:25 +08:00
---
aliases:
2023-05-02 23:27:11 +08:00
- ../panels/working-with-panels/configure-legend/
- visualizations/configure-legend/
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- cloud
- enterprise
- oss
2022-05-26 23:06:25 +08:00
title: Configure a legend
2023-12-14 05:24:26 +08:00
description: Configure a legend for your panel visualization
2023-11-28 04:00:57 +08:00
weight: 70
2024-05-21 23:16:47 +08:00
refs:
2024-05-22 22:40:20 +08:00
status-history:
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/status-history/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/status-history/
candlestick:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/candlestick/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/candlestick/
geomaps:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/geomap/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/geomap/
2024-05-21 23:16:47 +08:00
state-timeline:
2024-05-22 22:40:20 +08:00
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/state-timeline/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/state-timeline/
2024-05-22 22:40:20 +08:00
xy-chart:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/xy-chart/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/xy-chart/
2024-05-21 23:16:47 +08:00
trend:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/trend/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/trend/
calculations:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/query-transform-data/calculation-types/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/query-transform-data/calculation-types/
2024-05-22 22:40:20 +08:00
time-series:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/time-series/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/time-series/
2024-05-21 23:16:47 +08:00
histogram:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/histogram/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/histogram/
2024-05-22 22:40:20 +08:00
heatmaps:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/heatmap/
2024-05-21 23:16:47 +08:00
- pattern: /docs/grafana-cloud/
2024-05-22 22:40:20 +08:00
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/heatmap/
bar-chart:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/bar-chart/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/bar-chart/
pie-chart:
- pattern: /docs/grafana/
destination: /docs/grafana/< GRAFANA_VERSION > /panels-visualizations/visualizations/pie-chart/
- pattern: /docs/grafana-cloud/
destination: /docs/grafana-cloud/visualizations/panels-visualizations/visualizations/pie-chart/
2022-05-26 23:06:25 +08:00
---
2022-01-19 05:06:27 +08:00
# Configure a legend
2023-12-20 23:14:52 +08:00
A panel includes a legend that you can use to identify and interpret data displayed in a visualization. Each legend option adds context and clarity to the data illustrated in a visualization.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
## Supported visualizations
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
Legends are supported for the following visualizations:
2022-01-19 05:06:27 +08:00
2024-05-21 23:16:47 +08:00
- [Bar chart ](ref:bar-chart )
- [Candlestick ](ref:candlestick )
- [Histogram ](ref:histogram )
- [Pie chart ](ref:pie-chart )
- [State timeline ](ref:state-timeline )
- [Status history ](ref:status-history )
- [Time series ](ref:time-series )
- [Trend ](ref:trend )
- [XY chart ](ref:xy-chart )
2022-01-19 05:06:27 +08:00
2024-05-21 23:16:47 +08:00
[Geomaps ](ref:geomaps ) and [heatmaps ](ref:heatmaps ) also have legends, but they only provide the choice to display or not display a legend and don't support other legend options.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
## Legend options
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
You can find the following options under the **Legend** section in the panel edit pane.
2022-01-19 05:06:27 +08:00
2025-06-20 00:31:13 +08:00
{{< admonition type = "note" > }}
2023-12-20 23:14:52 +08:00
Not all of the options listed apply to all visualizations with legends.
2025-06-20 00:31:13 +08:00
{{< / admonition > }}
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
### Visibility
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
Set whether the legend is displayed or not. Use the switch to toggle a legend on or off.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
### Mode
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
Set the format in which the legend is displayed. Choose from:
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
- **List**
- **Table**
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
When you format a legend as a table, other information about the legend, such as associated [values ](#values ) or where it's located in the visualization, might be displayed as well.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
### Placement
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
Set where on the visualization a legend is displayed. Choose from:
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
- **Bottom**
- **Right**
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
### Width
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
If you set the legend placement to **Right** , the **Width** option becomes available. Leave the field empty to allow Grafana to automatically set the legend width or enter a value in the field.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
### Values
2022-01-19 05:06:27 +08:00
2024-05-21 23:16:47 +08:00
You can add more context to a visualization by adding series data values or [calculations ](ref:calculations ) to a legend. You can add as many values as you'd like. After you apply your changes, you can scroll the legend to see all values.
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00

2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
## Change a series color
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
By default, Grafana sets the colors of your series data, but you can change them through the panel legend. To change the series data color, follow these steps:
2022-01-19 05:06:27 +08:00
2023-12-20 23:14:52 +08:00
1. Navigate to the panel you want to update.
1. In the legend, click the color bar associated with the series.
1. Select a pre-set color in the **Colors** tab or set a custom color in the **Custom** tab, using the picker or RGB values.
1. Save the dashboard.
2022-01-19 05:06:27 +08:00

2023-12-20 23:14:52 +08:00
## Isolate series data in a visualization
Visualizations can often be visually complex, and include many data series. You can simplify the view by removing series data from the visualization through the legend, which isolates the data you want to see. When you do this, Grafana automatically creates a new override in the **Override** section.
To isolate a series, follow these steps:
1. Navigate to the panel you want to update.
1. In the legend, click the label of the series you want to isolate.
The system removes all other series data from view.
1. To incrementally add series data back to an isolated series, press the **Ctrl** or **Command** key and click the label of the series you want to add.
1. To save your changes so that they appear to all viewers of the panel, save the dashboard.
To revert back to the default view that includes all data, click any series label twice.
2022-01-19 05:06:27 +08:00
## Sort series
2023-12-20 23:14:52 +08:00
When you format a legend as a table and add values to it, you can sort series in the table by those values. To do so, follow these steps:
1. Navigate to the panel you want to update.
1. Hover over any part of the panel you want to work on to display the menu on the top right corner.
1. Click the menu and select **Edit** .
1. Scroll to the **Legend** section of the panel edit pane.
1. Under **Mode** , select **Table** .
1. Under **Values** , select the value or calculation that you want to show.
The legend table now displays values.
1. Click the calculation name header in the legend table to sort the values in the table in ascending or descending order.

2022-01-19 05:06:27 +08:00
2025-06-20 00:31:13 +08:00
{{< admonition type = "note" > }}
2023-12-20 23:14:52 +08:00
This feature is only supported for the following visualizations: bar chart, histogram, time series.
2025-06-20 00:31:13 +08:00
{{< / admonition > }}