

# Panels and visualizations in Grafana version 12
<a name="v12-panels"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The *panel* is the basic visualization building block in Grafana. Each panel has a query editor specific to the data source selected in the panel. The query editor allows you to build a query that returns the data you want to visualize.

There are a wide variety of styling and formatting options for each panel. Panels can be dragged, dropped, and resized to rearrange them on the dashboard.

Before you add a panel, ensure that you have configured a data source.

Additional panel types might be available by installing additional [plugins](grafana-plugins.md) to your workspace.

For details about using specific data sources, see [Connect to data sources](AMG-data-sources.md).

You can add interactive actions to visualizations that trigger API calls or navigate to URLs, with support for custom variables and one-click data links.

**Topics**
+ [Panel editor overview](v12-panels-editor-overview.md)
+ [The panel inspect view](v12-panels-panel-inspector.md)
+ [Query and transform data](v12-panels-query-xform.md)
+ [Configure panel options](v12-panels-configure-panel-options.md)
+ [Configure standard options](v12-panels-configure-standard-options.md)
+ [Configure a legend](v12-panels-configure-legend.md)
+ [Configure data links](v12-panels-configure-data-links.md)
+ [Configure value mappings](v12-panels-configure-value-mappings.md)
+ [Configure thresholds](v12-panels-configure-thresholds.md)
+ [Configure field overrides](v12-panels-configure-overrides.md)
+ [Visualizations available in Grafana version 12](v12-panels-viz.md)

# Panel editor overview
<a name="v12-panels-editor-overview"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

In the panel editor, you can update all the elements of a visualization, including the data source, queries, time range, and display options.

To add a panel to a new dashboard, select **\$1 Add visualization** in the middle of the dashboard. To add a panel to an existing dashboard, select **Add** in the dashboard header and select **Visualization** in the drop down. You can also copy and paste an existing panel from the same or a different dashboard.

## Panel menu
<a name="v12-panels-editor-menu"></a>

To access the panel editor, hover over the top-right corner of any panel. Select the panel menu icon that appears and select **Edit**.

The panel menu also gives you access to the following actions:
+ **View** – View the panel in full screen.
+ **Edit** – Open the panel editor to edit panel and visualization options.
+ **Share** – Share the panel as a link, or library panel.
+ **Explore** – Open the panel in **Explore**, where you can focus on your query.
+ **Inspect** – Open the **Inspect** drawer, where you can review the panel data, stats, metadata, JSON, and query.
  + **Data** – Open the **Inspect** drawer in the **Data** tab.
  + **Query** – Open the **Inspect** drawer in the **Query** tab.
  + **Panel JSON** – Open the **Inspect** drawer in the **JSON** tab.
+ **Extensions** – Access other actions provided by installed applications, such as declaring an incident. This option only appears if you have app plugins installed which contribute an extension to the panel menu.
+ **More** – Access other panel actions.
  + **Duplicate** – Make a copy of the panel. Duplicated panels query data separately from the original panel. If you want to use the same query results, you can use the `Dashboard` data source in the second panel.
  + **Copy** – Copy the panel to the clipboard.
  + **Create library panel** – Create a panel that can be imported into other dashboards.
  + **Create alert** – Open the alert rule configuration page in **Alerting**, where you can create a [Grafana-managed alert](v12-alerts.md) based on the panel queries.
  + **Hide legend** – Hide the panel legend.
  + **Get help** – Send a snapshot or panel data to Grafana Labs Technical Support.
+ **Remove** – Remove the panel from the dashboard.

## Panel editor
<a name="v12-panels-editor-view"></a>

This section describes the areas of the Grafana panel editor.
+ Panel header – The header section lists the dashboard in which the panel appears and the following controls:
  + **Discard** – Discards changes you have made to the panel since you last saved the dashboard.
  + **Save** – Saves changes you made to the panel.
  + **Apply** – Applies changes you made and closes the panel editor, returning you to the dashboard. You will have to save the dashboard to persist the applied changes.
+ Visualization preview – The visualization preview section contains the following options:
  + **Table view** – Convert any visualization to a table so you can see the data. Table views are helpful for troubleshooting. This view only contains the raw data. It does not include transformations you might have applied to the data or the formatting options available in the [Table](v12-panels-table.md) visualization.
  + **Fill** – The visualization preview fills the available space. If you change the width of the side pane or height of the bottom pane the visualization changes to fill the available space.
  + **Actual** – The visualization preview will have the exact size as the size on the dashboard. If not enough space is available, the visualization will scale down preserving the aspect ratio.
  + **Time range controls** – **Default** is either the browser local timezone or the timezone selected at a higher level.
+ Data section – The data section contains tabs where you enter queries, transform your data, and create alert rules (if applicable).
  + **Query tab** – Select your data source and enter queries here. For more information, see [Query and transform data](v12-panels-query-xform.md). When you initially create a dashboard, you are prompted to select a data source. You can update the data source or the query in this tab.
  + **Transform tab** – Apply data transformations. For more information, see [Query and transform data](v12-panels-query-xform.md).
  + **Alert tab** – Write alert rules. For more information, see [Alerts in Grafana version 12](v12-alerts.md).
+ Panel display options – The display options section contains tabs where you configure almost every aspect of your data visualization. The details vary based on the visualization type selected.

## Panel inspect drawer
<a name="v12-panels-editor-inspect"></a>

The inspect drawer helps you understand and troubleshoot your panels. You can view the raw data for any panel, export that data to a comma-separated values (CSV) file, view query requests, and export panel and data JSON.

**Note**  
Not all panel types include all tabs. For example, dashboard list panels do not have raw data to inspect, so they do not display the Stats, Data, or Query tabs.

The panel inspector consists of the following options:
+ The panel inspect drawer displays as a drawer on the right side. Select the arrow in the upper right corner to expand or reduce the drawer pane.
+ **Data tab** – Shows the raw data returned by the query with transformations applied. Field options such as overrides and value mappings are not applied by default.
+ **Stats tab** – Shows how long your query takes and how much it returns.
+ **JSON tab** – Allows you to view and copy the panel JSON, panel data JSON, and data frame structure JSON. This is useful if you are provisioning or administering Grafana.
+ **Query tab** – Shows you the requests to the server sent when Grafana queries the data source.
+ **Error tab** – Shows any errors returned by a query. The tab is only visible when a query returns an error.

# The panel inspect view
<a name="v12-panels-panel-inspector"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The panel inspect view, which you can open via the panel menu, helps you understand and troubleshoot your panels. You can inspect the raw data for any Amazon Managed Grafana panel, export that data to a comma-separated values (CSV) file, view query requests, and export panel and data JSON.

**Note**  
Not all panel types include all tabs. For example, dashboard list panels do not have raw data to inspect, so they do not display the Stats, Data, or Query tabs.

The panel inspector consists of the following options:

1. The panel inspector displays **Inspect:** at the top of the pane. Select the arrow in the upper right corner to expand or reduce the pane.

1. **Data tab** – Shows the raw data returned by the query with transformations applied. Field options such as overrides and value mappings are not applied by default.

1. **Stats tab** – Shows how long your query takes and how much it returns.

1. **JSON tab** – Allows you to view and copy the panel JSON, panel data JSON, and data frame structure JSON. This is useful if you are provisioning or administering Grafana.

1. **Query tab** – Shows you the requests sent to the server when Grafana queries the data source.

1. **Error tab** – Shows any errors. Only visible when a query returns an error.

## Downloading raw query results
<a name="v12-panels-raw-query-results"></a>

Amazon Managed Grafana generates a CSV file that contains your data, including any transformations to that data. You can choose to view the data before or after the panel applies field options or field option overrides.

**To download raw query results**

1. Edit the panel that contains the query data you want to download.

1. In the query editor, select **Query Inspector**.

1. Select **Data**.

   If your panel contains multiple queries or queries multiple nodes, then you have additional options.
   + **Select result** – Choose which result set data you want to view.
   + **Transform data**
   + **Join by time** – View raw data from all your queries at once, one result set per column. Select a column heading to reorder the data.

1. To see data before the system applies field overrides, select the **Formatted data** toggle.

1. To download a CSV file specifically formatted for Excel, select the **Download for Excel** toggle.

1. Select **Download CSV**.

## Inspecting query performance
<a name="v12-panels-query-performance"></a>

The **Stats** tab displays statistics that tell you how long your query takes, how many queries you send, and the number of rows returned. This information can help you troubleshoot your queries, especially if any of the numbers are unexpectedly high or low.

**To inspect query performance**

1. Edit the panel that contains the query with performance you want to inspect.

1. In the query editor, select **Query Inspector**.

1. Select **Stats**.

Statistics are displayed in read-only format.

## Inspecting query request and response
<a name="v12-panels-query-request-response"></a>

You can inspect query request and response data when you want to troubleshoot a query that returns unexpected results, or fails to return expected results.

1. Edit the panel that contains the query you want to export.

1. In the query editor, select **Query Inspector**.

1. Select **Refresh**.

   The panel populates with response data.

1. Make adjustments, as necessary and re-run the query.

1. To download the query request and response data, click the **Copy to clipboard** icon and paste the results into another application.

# Query and transform data
<a name="v12-panels-query-xform"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Amazon Managed Grafana supports many types of [data sources](AMG-data-sources.md). Data source *queries* return data that Grafana can *transform* and visualize. Each data source uses its own query language, and data source plugins each implement a query-building user interface called a query editor.

**Topics**
+ [About queries](#v12-panels-query-xform-about)
+ [Navigate the query tab](#v12-panels-query-xform-navigate)
+ [Adding a query](#v12-panels-query-xform-add)
+ [Manage queries](#v12-panels-query-xform-manage)
+ [Query options](#v12-panels-query-xform-options)
+ [Write expression queries](v12-panels-query-xform-expressions.md)
+ [Share query results with another panel](v12-panels-query-share.md)
+ [Transform data](v12-panels-xform.md)
+ [Troubleshoot queries](v12-panels-query-troubleshoot.md)
+ [Calculation types](v12-panels-calculation-types.md)

## About queries
<a name="v12-panels-query-xform-about"></a>

Grafana panels communicate with data sources via queries, which retrieve data for the visualization. A query is a question written in the query language used by the data source.

You can configure query frequency and data collection limits in the panel’s data source options. Grafana supports up to 26 queries per panel.

You can find more information about each data source’s query language in the [Data sources](AMG-data-sources.md) section.

**Query editors**

Each data source’s *query editor* provides a customized user interface that helps you write queries that take advantage of its unique capabilities.

Because of the differences between query languages, each data source query editor looks and functions differently. Depending on your data source, the query editor might provide auto-completion features, metric names, variable suggestions, or a visual query-building interface.

For details on a specific data source’s unique query editor features, including information about queries and syntax, see the data source documentation:
+ For data sources included with Amazon Managed Grafana, see [Built-in data sources](AMG-data-sources-builtin.md).
+ For data sources included with Grafana Enterprise, see [Connect to Enterprise data sources](AMG-data-sources-enterprise.md).
+ For other data source plugins that you install via the [Find plugins with the plugin catalog](grafana-plugins.md#plugin-catalog), the documentation is linked within the listing in the plugin catalog.

**Query syntax**

Data sources use different query languages to request data. For details on a specific data source’s unique query language, refer to its documentation.

**PostgreSQL example:**

```
SELECT hostname FROM host WHERE region IN($region)
```

**PromQL example:**

```
query_result(max_over_time(<metric>[${__range_s}s]) != <state>)
```

**Special data sources**

Grafana also includes three special data sources: **Grafana**, **Mixed**, and **Dashboard**. For more information, see [Connect to data sources](AMG-data-sources.md).

## Navigate the query tab
<a name="v12-panels-query-xform-navigate"></a>

A panel’s **Query** tab consists of the following elements:
+ **Data source selector** – Selects the data source to query.
+ **Query options** – Sets maximum data retrieval parameters and query run time intervals.
+ **Query inspector button** – Opens the query inspector panel, where you can view and optimize your query.
+ **Query editor list** – Lists the queries you’ve written.
+ **Expressions** – Uses the expression builder to create alert expressions. For more information about expressions, see [Write expression queries](v12-panels-query-xform-expressions.md).

## Adding a query
<a name="v12-panels-query-xform-add"></a>

A query returns data that Grafana visualizes in dashboard panels. When you create a panel, Grafana automatically selects the default data source.

**To add a query**

1. Edit the panel to which you’re adding a query.

1. Choose the **Query** tab.

1. Choose the **Data source** dropdown menu and select a data source.

1. Choose **Query options** to configure the maximum number of data points you need. For more information about query options, see [Query options](#v12-panels-query-xform-options).

1. Write the query using the query editor.

1. Choose **Apply**.

Grafana queries the data source and visualizes the data.

## Manage queries
<a name="v12-panels-query-xform-manage"></a>

Grafana organizes queries in collapsible query rows. Each query row contains a query editor and is identified with a letter (A, B, C, and so on).

To manage your queries, you can copy queries, hide queries, remove queries, reorder queries, and toggle help for the query editor.

## Query options
<a name="v12-panels-query-xform-options"></a>

Choose **Query options** next to the data source selector to see settings for the selected data source. Changes you make here affect only queries made in this panel.

Grafana sets defaults that are shown in dark gray text. Changes are displayed in white text. To return a field to the default setting, delete the white text from the field.

Panel data source query options include:
+ **Max data points** – If the data source supports it, this sets the maximum number of data points for each series returned. If the query returns more data points than the max data points setting, then the data source reduces the number of points returned by aggregating them together by average, max, or another function.

  You can limit the number of points to improve query performance or smooth the visualized line. The default value is the width (or number of pixels) of the graph, because you can only visualize as many data points as the graph panel has room to display.

  With streaming data, Grafana uses the max data points value for the rolling buffer. Streaming is a continuous flow of data, and buffering divides the stream into chunks.
+ **Min interval** – Sets a minimum limit for the automatically calculated interval, which is typically the minimum scrape interval. If a data point is saved every 15 seconds, you don’t benefit from having an interval lower than that. You can also set this to a higher minimum than the scrape interval to retrieve queries that are more coarse-grained and well-functioning.
+ **Interval** – Sets a time span that you can use when aggregating or grouping data points by time.

  Grafana automatically calculates an appropriate interval that you can use as a variable in templated queries. The variable is measured in either seconds (`$__interval`) or milliseconds (`$__interval_ms`).

  Intervals are typically used in aggregation functions like sum or average. For example, this is a Prometheus query that uses the interval variable: `rate(http_requests_total[$__interval])`.

  This automatic interval is calculated based on the width of the graph. As the user zooms out on a visualization, the interval grows, resulting in a more coarse-grained aggregation. Likewise, if the user zooms in, the interval decreases, resulting in a more fine-grained aggregation.

  For more information, see [Global variables](v12-dash-variable-add.md#v12-dash-variable-add-global).
+ **Relative time** – Overrides the relative time range for individual panels, which causes them to be different than what is selected in the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different time periods or days on the same dashboard.
**Note**  
Panel time overrides have no effect when the dashboard’s time range is absolute.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-query-xform.html)
+ **Time shift** – Overrides the time range for individual panels by shifting its start and end relative to the time picker. For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker.
**Note**  
Panel time overrides have no effect when the dashboard's time range is absolute.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-query-xform.html)
+ **Cache timeout** – *(Visible only if available in the data source)* Overrides the default cache timeout if your time series store has a query cache. Specify this value as a numeric value in seconds.

# Write expression queries
<a name="v12-panels-query-xform-expressions"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Server-side expressions enable you to manipulate data returned from queries with math and other operations. Expressions create new data and do not manipulate the data returned by data sources.

## About expressions
<a name="v12-panels-query-about"></a>

Server-side expressions allow you to manipulate data returned from queries with math and other operations. Expressions create new data and do not manipulate the data returned by data sources, aside from some minor data restructuring to make the data acceptable input for expressions.

**Using expressions**

Expressions are most commonly used by [Grafana alerting](v12-alerts.md). The processing is done server-side, so expressions can operate without a browser session. However, expressions can also be used with backend data sources and visualization.

**Note**  
Expressions do not work with legacy dashboard alerts.

Expressions are meant to augment data sources by enabling queries from different data sources to be combined or by providing operations unavailable in a data source.

**Note**  
When possible, you should do data processing inside the data source. Copying data from storage to the Grafana server for processing is inefficient, so expressions are targeted at lightweight data processing.

Expressions work with data source queries that return time series or numeric data. They also operate on [multiple-dimensional data](getting-started-grafanaui.md#time-series-dimensions). For example, a query that returns multiple series, where each series is identified by labels or tags.

An individual expression takes one or more queries or other expressions as input and adds data to the result. Each individual expression or query is represented by a variable that is a named identifier known as its RefID (e.g., the default letter `A` or `B`).

To reference the output of an individual expression or a data source query in another expression, this identifier is used as a variable.

**Types of expressions**

Expressions work with two types of data.
+ A collection of time series.
+ A collection of numbers, where each number is an item.

Each collection is returned from a single data source query or expression and represented by the RefID. Each collection is a set, where each item in the set is uniquely identified by its dimensions which are stored as [labels](getting-started-grafanaui.md#labels) or key-value pairs.

**Data source queries**

Server-side expressions only support data source queries for backend data sources. The data is generally assumed to be labeled time series data. 

Data source queries, when used with expressions, are run by the expression engine. When it does this, it restructures data to be either one time series or one number per data frame. So for example if using a data source that returns multiple series on one frame in the table view, you might notice it looks different when run with expressions.

Currently, the only non-time series format (number) is supported when using data frames are you have a table response that returns a data frame with no time, string columns, and one number column:

The following example table produces a number that works with expressions. The string columns become labels and the number column the corresponding value. For example `{"Loc": "MIA", "Host": "A"}` with a value of 1.


| Loc | Host | Avg\$1CPU | 
| --- | --- | --- | 
| MIA | A | 1 | 
| NYC | B | 2 | 

**Operations**

You can use the following operations in expressions: math, reduce, and resample.

**Math**

Math is for free-form math formulas on time series or number data. Math operations take numbers and time series as input and changes them to different numbers and time series.

Data from other queries or expressions are referenced with the RefID prefixed with a dollar sign, for example `$A`. If the variable has spaces in the name, then you can use a brace syntax like `${my variable}`.

Numeric constants can be in decimal (`2.24`), octal (with a leading zero like `072`), or hex (with a leading 0x like `0x2A`). Exponentials and signs are also supported (for example, `-0.8e-2`).

**Operators**

The arithmetic (`+`, binary and unary `-`, `*`, `/`, `%`, exponent `**`), relational (`<`, `>`, `==`, `!=`, `>=`, `<=`), and logical (`&&`, `||`, and unary `!`) operators are supported.

How the operation behaves with data depends on if it is a number or time series data.

With binary operations, such as `$A + $B` or `$A || $B`, the operator is applied in the following ways depending on the type of data:
+ If both `$A` and `$B` are a number, then the operation is performed between the two numbers.
+ If one variable is a number, and the other variable is a time series, then the operation between the value of each point in the time series and the number is performed.
+ If both `$A` and `$B` are time series data, then the operation between each value in the two series is performed for each time stamp that exists in both `$A` and `$B`. The `Resample` operation can be used to line up time stamps.

Summary:
+ Number <Operation> number = number
+ Number <Operation> series = series
+ Series <Operation> series = series

Because expressions work with multiple series or numbers represented by a single variable, binary operations also perform a union (join) between the two variables. This is done based on the identifying labels associated with each individual series or number.

So if you have numbers with labels like `{host=web01}` in `$A` and another number in `$B` with the same labels then the operation is performed between those two items within each variable, and the result will share the same labels. The rules for the behavior of this union are as follows:
+ An item with no labels will join to anything.
+ If both `$A` and `$B` each contain only one item (one series, or one number), they will join.
+ If labels are exact match they will join.
+ If labels are a subset of the other, for example an item in `$A` is labeled `{host=A,dc=MIA}` and an item in `$B` is labeled `{host=A}` they will join.
+ If within a variable such as `$A` there are different tag keys for each item, the join behavior is undefined.

The relational and logical operators return 0 for false 1 for true.

**Math Functions**

While most functions exist in the own expression operations, the math operation does have some functions that similar to math operators or symbols. When functions can take either numbers or series, than the same type as the argument will be returned. When it is a series, the operation of performed for the value of each point in the series.

*abs*

abs returns the absolute value of its argument which can be a number or a series. For example `abs(-1)` or `abs($A)`.

*is\$1inf*

is\$1inf takes a number or a series and returns `1` for `Inf` values (negative or positive) and `0` for other values. For example `is_inf($A)`.

**Note**  
If you need to specifically check for negative infinity for example, you can do a comparison like `$A == infn()`.

*is\$1nan*

is\$1nan takes a number or a series and returns `1` for `NaN` values and `0` for other values. For example `is_nan($A)`. This function is required for this check because `NaN` is not equal to `NaN`.

*is\$1null*

is\$1null takes a number or a series and returns `1` for `null` values and `0` for other values. For example `is_null($A)`.

*is\$1number*

is\$1number takes a number or a series and returns `1` for all real number values and `0` for other values (which are `null`, `Inf+`, `Inf-`, and `NaN`). For example `is_number($A)`.

*log*

Log returns the natural logarithm of its argument which can be a number or a series. If the value is less than 0, `NaN` is returned. For example `log(-1)` or `log($A)`.

*inf, infn, nan, and null*

The inf, infn, nan, and null functions all return a single value of the name. They primarily exist for testing. Example: `null()`.

*round*

Round returns a rounded integer value. For example, `round(3.123)` or `round($A)`.

*ceil*

Ceil rounds the number up to the nearest integer value. For example, `ceil(3.123)` returns `4`.

*floor*

Floor rounds the number down to the nearest integer value. For example, `floor(3.123`) returns `3`.

**Reduce**

Reduce takes one or more time series returned from a query or an expression and turns each series into a single number. The labels of the time series are kept as labels on each outputted reduced number.

*Fields:*
+ **Function** – The reduction function to use
+ **Input** – The variable (refID (such as `A`)) to resample
+ **Mode** – Allows control behavior of reduction function when a series contains non-numerical values (null, NaN, \$1-Inf)

**Reduction Functions**

*Count*

Count returns the number of points in each series.

*Mean*

Mean returns the total of all values in each series divided by the number of points in that series. In `strict` mode if any values in the series are null or nan, or if the series is empty, NaN is returned.

*Min and Max*

Min and Max return the smallest or largest value in the series respectively. In `strict` mode if any values in the series are null or nan, or if the series is empty, NaN is returned.

*Sum*

Sum returns the total of all values in the series. If series is of zero length, the sum will be 0. In `strict` mode if there are any NaN or Null values in the series, NaN is returned.

*Last*

Last returns the last number in the series. If the series has no values then returns NaN.

**Reduction Modes**

*Strict*

In Strict mode the input series is processed as is. If any values in the series are non-numeric (null, NaN or \$1-Inf), NaN is returned.

*Drop Non-Numeric*

In this mode all non-numeric values (null, NaN or \$1-Inf) in the input series are filtered out before running the reduction function.

*Replace Non-Numeric*

In this mode all non-numeric values are replaced by a pre-defined value.

**Resample**

Resample changes the time stamps in each time series to have a consistent time interval. The main use case is so you can resample time series that do not share the same timestamps so math can be performed between them. This can be done by resample each of the two series, and then in a Math operation referencing the resampled variables.

*Fields:*
+ **Input** – The variable of time series data (refID (such as `A`)) to resample
+ **Resample** to – The duration of time to resample to, for example `10s`. Units can be `s` for seconds, `m` for minutes, `h` for hours, `d` for days, `w` for weeks, and `y` for years.
+ **Downsample** – The reduction function to use when there are more than one data point per window sample. See the reduction operation for behavior details.
+ **Upsample** – The method to use to fill a window sample that has no data points.
  + **pad** fills with the last knowm value
  + **backfill** with next known value
  + **fillna** to fill empty sample windows with NaNs

## Write an expression
<a name="v12-panels-query-write"></a>

If your data source supports them, then Grafana displays the **Expression** button and shows any existing expressions in the query editor list.

**To write an expression**

1. Open the panel.

1. Below the query, choose **Expression**.

1. In the **Operation** field, select the type of expression you want to write.

1. Write the expression.

1. Choose **Apply**.

## Special cases
<a name="v12-panels-query-special"></a>

When any queried data source returns no series or numbers, the expression engine returns `NoData`. For example, if a request contains two data source queries that are merged by an expression, if `NoData` is returned by at least one of the data source queries, then the returned result for the entire query is `NoData`. For more information about how Grafana Alerting processes `NoData` results, see [Configure Grafana managed alert rules](v12-alerting-configure-grafanamanaged.md).

In the case of using an expression on multiple queries, the expression engine requires that all of the queries return an identical timestamp. For example, if using math to combine the result of multiple SQL queries which each use `SELECT NOW() AS "time"`, the expression will only work if all queries evaluate `NOW()` to an identical timestamp, which does not always happen. To resolve this, you can replace `NOW()` with an arbitrary time, such as `SELECT 1 AS "time"`, or any other valid UNIX timestamp.

# Share query results with another panel
<a name="v12-panels-query-share"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Grafana lets you use the query result from one panel for any other panel in the dashboard. Sharing query results across panels reduces the number of queries made to your data source, which can improve the performance of your dashboard.

The *Dashboard* data source lets you select a panel in your dashboard that contains the queries you want to share the results for. Instead of sending a separate query for each panel, Grafana sends one query and other panels use the query results to construct visualizations.

This strategy can drastically reduce the number of queries being made when you for example have several panels visualizing the same data.

**To share query results**

1. [Create a dashboard](v12-dash-creating.md).

1. Change the title to `Source panel`. You'll use this panel as a source for the other panels.

1. Define the query or queries that you want to share.

   If you don't have a data source available, use the **Grafana** data source, which returns a random time series that you can use for testing.

1. Add a second panel and select the **Dashboard** data source in the query editor.

1. In the **Use results from panel list**, select the first panel you created.

All queries defined in the source panel are now available to the new panel. Queries made in the source panel can be shared with multiple panels.

You can click on any of the queries to go to the panel where they are defined.

# Transform data
<a name="v12-panels-xform"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Transformations are a powerful way to manipulate data returned by a query before the system applies a visualization. Using transformations, you can:
+ Rename fields
+ Join time series data
+ Perform mathematical operations across queries
+ Use the output of one transformation as the input to another transformation

For users that rely on multiple views of the same dataset, transformations offer an efficient method of creating and maintaining numerous dashboards.

You can also use the output of one transformation as the input to another transformation, which results in a performance gain.

**Note**  
Sometimes the system cannot graph transformed data. When that happens, click the **Table view** toggle above the visualization to switch to a table view of the data. This can help you understand the final result of your transformations.

## Transformation types
<a name="v12-panels-xform-types"></a>

Grafana provides a number of ways that you can transform data. There is a complete list of transformation functions below.

## Order of transformations
<a name="v12-panels-xform-order"></a>

When there are multiple transformations, Grafana applies them in the order they are listed. Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.

The order in which Grafana applies transformations directly impacts the results. For example, if you use a Reduce transformation to condense all the results of one column into a single value, then you can only apply transformations to that single value.

## Add a transformation function to data
<a name="v12-panels-xform-add"></a>

The following steps guide you in adding a transformation to data. This documentation does not include steps for each type of transformation.

**To add a transformation to a panel**

1. Navigate to the panel where you want to add one or more transformations.

1. Hover over any part of the panel to display the actions menu on the top right corner.

1. From the actions menu choose **Edit**.

1. Select the **Transform** tab.

1. Select a transformation. A transformation row appears where you configure the transformation options.

1. To apply another transformation, Choose **Add transformation**. This transformation acts on the result set returned by the previous transformation.

## Debug a transformation
<a name="v12-panels-xform-debug"></a>

To see the input and the output result sets of the transformation, choose the debug (bug) icon on the right side of the transformation row. This will display the input data, and the result of the transformation as output.

The input and output results sets can help you debug a transformation.

## Disable a transformation
<a name="v12-panels-xform-disable"></a>

You can disable or hide a transformation by choosing the show (eye) icon on the top right of the transformation row. This disables the applied actions of that specific transformation and can help to identify issues when you change several transformations one after another.

## Filter a transformation
<a name="v12-panels-xform-filter"></a>

If your transformation uses more than one query, you can filter these, and apply the selected transformation to only one of the queries. To do this, choose the filter icon on the top right of the transformation row. This opens a dropdown with a list of queries used on the panel. From here, you can select the query you want to transform.

You can also filter by annotations (which includes exemplars) to apply transformations to them. When you do so, the list of fields changes to reflect those in the annotation or exemplar tooltip.

The filter icon is always displayed if your panel has more than one query or source of data (that is panel or annotation data), but it may not work if previous transformations for merging the queries' outputs are applied. This is because one transformation takes the output of the previous one.

## Delete a transformation
<a name="v12-panels-xform-delete"></a>

We recommend that you remove transformations that you don’t need. When you delete a transformation, you remove the data from the visualization.

Prerequisites:

Identify all dashboards that rely on the transformation and inform impacted dashboard users.

**To delete a transformation**

1. Open a panel for editing.

1. Select the **Transform** tab.

1. Choose the trash icon next to the transformation you want to delete.

# Transformation functions
<a name="v12-panels-xform-functions"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

You can perform the following transformations on your data.

## Add field from calculation
<a name="v12-panels-xform-funcs-add"></a>

Use this transformation to add a new field calculated from two other fields. Each transformation allows you to add one new field.
+ **Mode** - Select a mode:
  + **Reduce row** – Apply selected calculation on each row of selected fields independently.
  + **Binary operation** – Apply basic binary operations (for example, sum or multiply) on values in a single row from two selected fields.
  + **Unary operation** – Apply basic unary operations on values in a single row from a selected field. The available operations are:
    + **Absolute value (abs)** – Returns the absolute value of a given expression. It represents the distance from zero as a positive number.
    + **Natural exponential (exp)** – Returns *e* raised to the power of a given expression.
    + **Natural logarithm (ln)** – Returns the natural logarithm of a given expression.
    + **Floor (floor)** – Returns the largest integer less than or equal to a given expression.
    + **Ceiling (ceil)** – returns the smallest integer greater than or equal to a given expression.
  + **Cumulative functions** – Apply functions on teh current row and all preceding rows.
    + **Total** – Calculates the cumulative total up to and including the current row.
    + **Mean** – Calculates the mean up to and including the current row.
  + **Window functions** – Apply window functions. The window can either be *trailing* or *centered*. With a trailing window the current row will be the last row in the window. With a centered window, the window will be centered on the current row. For even windows sizes, the window will be centered between the current row and the previous row.
    + **Mean** – Calculates the moving mean or running average.
    + **** – Calculates the moving standard deviation.
    + **Variance** – Calculate the moving variance.
  + **Row index** – Insert a field with the row index.
+ **Field name** – Select the names of fields you want to use in the calculation for the new field.
+ **Calculation** – If you select **Reduce row** mode, then the **Calculation** field appears. Select the field to see a list of calculation choices you can use to create the new field. For information about available calculations, refer to [Calculation types](v12-panels-calculation-types.md).
+ **Operation** – If you select **Binary operation** or **Unary operation** mode, then the **Operation** fields appear. These fields allow you to do basic math operations on values in a single row from two selected fields. You can also use numerical values for binary operations.
+ **As percentile** – If you select **Row index** mode, then the **As percentile** switch appears. This switch allows you to transform the row index as a percentage of the total number of rows.
+ **Alias** – (Optional) Enter the name of your new field. If you leave this blank, then the field will be named to match the calculation.
+ **Replace all fields** – (Optional) Select this option if you want to hide all other fields and display only your calculated field in the visualization.

**Note**  
**Cumulative functions** and **Window functions** are current in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

## Concatenate fields
<a name="v12-panels-xform-funcs-concat"></a>

**Concatenate fields**

Use this transformation to combines all fields from all frames into one result.

For example, if you have separate queries retrieving temperature and uptime data (query A) and air quality index and error information (query b), applying the concatenate transformation yields a consolidated data frame with all relevant information in one view.

Consider these two following.

*Query A:*


| Temp | Uptime | 
| --- | --- | 
| 15.4 | 1230233 | 

*Query B:*


| AQI | Errors | 
| --- | --- | 
| 3.2 | 5 | 

After you concatenate the fields, the data frame would be:


| Temp | Uptime | AQI | Errors | 
| --- | --- | --- | --- | 
| 15.4 | 1230233 | 3.2 | 5 | 

This transformation simplifies the process of merging data from different sources, providing a comprehensive view for analysis and visualization.

## Config from query results
<a name="v12-panels-xform-funcs-config"></a>

**Config from query results**

Use this transformation to select one query and extract standard options like **Min**, **Max**, **Unit** and **Thresholds** and apply them to other query results. This enables dynamic visualization configuration, based on the data returned by a specific query.

**Options**
+ **Config query** – Select the query that returns the data you want to use as configuration.
+ **Apply to** – Select the fields or series to which the configuration should be applied.
+ **Apply to options** – Specify a field type or use a field name regex, depending on your selection in **Apply to**.

**Field mapping table**

Below the configuration options, you'll find the field mapping table. This table lists all fields found in the data returned by the config query, along with the **Use as** and **Select** options. It provides control over mapping fields to config properties, and for multiple rows, it allows you to choose which value to select.

The following example shows an input query and a query used as field configuration.

*Input query*


| Time | Value | 
| --- | --- | 
| 1626178119127 | 10 | 
| 1626178119129 | 30 | 

*Config query*


| Time | Value | 
| --- | --- | 
| 1626178119127 | 100 | 
| 1626178119129 | 100 | 

*Output query (same as input, but now with config on the value field)*


| Time | Value (config: Max=100) | 
| --- | --- | 
| 1626178119127 | 10 | 
| 1626178119129 | 30 | 

Each field now has a maximum configuration option set. Options such as **Min**, **Max**, **Unit**, and **Thresholds** are part of teh field configuration. If set, they are used by the visualization instead of any options manually configured in the panel editor options pane.

**Value mappings**

You can also transform a query result into value mappings. With this option, every row in the configuration query result defines a single value mapping row. See the following example.

*Config query result*


| Value | Text | Color | 
| --- | --- | --- | 
| L | Low | blue | 
| M | Medium | green | 
| H | High | red | 

*In the field mapping, specify:*


| Field | Use as | Select | 
| --- | --- | --- | 
| Value | Value mappings / Value | All values | 
| Text | Value mappings / Text | All values | 
| Color | Value mappings / Color | All values | 

Grafana builds value mappings from your query result and applies them to the real data query results. You should see values being mapped and colored according to the config query results.

## Convert field type
<a name="v12-panels-xform-funcs-convert"></a>

Use this transformation to modify the field type of the specified field.

This transformation has the following options:
+ **Field** – Select from available fields.
+ **as** – Select the FieldType to convert to.
  + **Numeric** – attempts to make the values numbers.
  + **String** – will make the values strings.
  + **Time** – attempts to parse the values as time.
    + Will show an option to specify a DateFormat as input by a string, like `yyyy-mm-dd` or `DD MM YYYY hh:mm:ss`.
  + **Boolean** – will make the values Boolean.
  + **Enum** – will make the values enums.
    + Will show a table to manage the enums.
  + **Other** – attempts to parse the values as json.

For example consider the following query that could be modified by selecting the time field, as **Time**, and Date Format as `YYYY`.


| Time | Mark | Value | 
| --- | --- | --- | 
| 2017-07-01 | above | 25 | 
| 2018-08-02 | below | 22 | 
| 2019-09-02 | below | 29 | 
| 2020-10-04 | above | 22 | 

The result:


| Time | Mark | Value | 
| --- | --- | --- | 
| 2017-01-01 00:00:00 | above | 25 | 
| 2018-01-01 00:00:00 | below | 22 | 
| 2019-01-01 00:00:00 | below | 29 | 
| 2020-01-01 00:00:00 | above | 22 | 

This transformation allows you to flexibly adapt your data types, ensuring compatibility and consistency in your visualizations.

## Extract Fields
<a name="v12-panels-xform-funcs-extract"></a>

Use this transformation to select a source of data and extract content from it in different formats. This transformation has the following fields:
+ **Source** – Select the field for the source of data.
+ **Format** – Choose one of the following:
  + **JSON** – Parse JSON content from the source.
  + **Key\$1value pairs** – Parse content in the format `a=b` or `c:d` from the source.
  + **Auto** – Discover fields automatically.
  + **Regex** – Extract fields using regular expressions for more powerful field extraction from text data.
+ **Replace All Fields** – (Optional) Select this option to hide all other fields and display only your calculated field in the visualization.
+ **Keep Time** - (Optional) Available only if **Replace All Fields** is true. Keeps the time field in the output.

Consider the following dataset:

**Dataset Example**


| Timestamp | json\$1data | 
| --- | --- | 
| 1636678740000000000 | \$1"value": 1\$1 | 
| 1636678680000000000 | \$1"value": 5\$1 | 
| 1636678620000000000 | \$1"value": 12\$1 | 

You could prepare the data to be used by a [Time series panel](v12-panels-time-series.md) with this configuration:
+ Source: json\$1data
+ Format: JSON
  + Field: value
  + Alias: my\$1value
+ Replace all fields: true
+ Keep time: true

This will generate the following output:

**Transformed Data**


| Timestamp | my\$1value | 
| --- | --- | 
| 1636678740000000000 | 1 | 
| 1636678680000000000 | 5 | 
| 1636678620000000000 | 12 | 

With this transformation, you can extract and format data in various ways. You can customize the extraction format based on your specific data needs.

## Lookup fields from resource
<a name="v12-panels-xform-funcs-lookup"></a>

Use this transformation to enrich a field value by looking up additional fields from an external source.

This transformation has the following fields:
+ **Field** – Select a text field from your dataset.
+ **Lookup** – Choose from **Countries**, **USA States**, and **Airports**.

**Note**  
This transformation only supports spatial data.

For example, if you have this data:

**Dataset Example**


| Location | Values | 
| --- | --- | 
| AL | 0 | 
| AK | 10 | 
| Arizona | 5 | 
| Arkansas | 1 | 
| Somewhere | 5 | 

With this configuration:
+ Field: location
+ Lookup: USA States

You’ll get the following output:

**Transformed Data**


| Location | ID | Name | Lng | Lat | Values | 
| --- | --- | --- | --- | --- | --- | 
| AL | AL | Alabama | -80.891064 | 12.448457 | 0 | 
| AK | AK | Arkansas | -100.891064 | 24.448457 | 10 | 
| Arizona |  |  |  |  | 5 | 
| Arkansas |  |  |  |  | 1 | 
| Somewhere |  |  |  |  | 5 | 

This transformation lets you augment your data by fetching additional information from external sources, providing a more comprehensive dataset for analysis and visualization.

## Filter data by query refId
<a name="v12-panels-xform-funcs-queryrefid"></a>

Use this transformation to hide one or more queries in panels that have multiple queries.

Grafana displays the query identification letters in dark gray text. Choose a query identifier to toggle filtering. If the query letter is white, then the results are displayed. If the query letter is dark, then the results are hidden.

**Note**  
This transformation is not available for Graphite because this data source does not support correlating returned data with queries.

## Filter data by values
<a name="v12-panels-xform-funcs-values"></a>

Use this transformation to selectively filter data points directly within your visualization. This transformation provides options to include or exclude data based on one or more conditions applied to a selected field.

This transformation is very useful if your data source does not natively filter by values. You might also use this to narrow values to display if you are using a shared query.

The available conditions for all fields are:
+ **Regex** – Match a regex expression.
+ **Is Null** – Match if the value is null.
+ **Is Not Null** – Match if the value is not null.
+ **Equal** – Match if the value is equal to the specified value.
+ **Different** – Match if the value is different than the specified value.
+ **Substring** – Match if the value contains the specified text.

Additional available conditions for number fields are:
+ **Greater** – Match if the value is greater than the specified value.
+ **Lower** – Match if the value is lower than the specified value.
+ **Greater or equal** – Match if the value is greater or equal.
+ **Lower or equal** – Match if the value is lower or equal.
+ **Range** – Match a range between a specified minimum and maximum, min and max included.

Consider the following dataset:


| Time | Temperature | Altitude | 
| --- | --- | --- | 
| 2020-07-07 11:34:23 | 32 | 101 | 
| 2020-07-07 11:34:22 | 28 | 125 | 
| 2020-07-07 11:34:21 | 26 | 110 | 
| 2020-07-07 11:34:20 | 23 | 98 | 
| 2020-07-07 10:32:24 | 31 | 95 | 
| 2020-07-07 10:31:22 | 20 | 85 | 
| 2020-07-07 09:30:57 | 19 | 101 | 

If you **Include** the data points that have a temperature below 30°C, the configuration will look as follows:
+ Filter Type: 'Include'
+ Condition: Rows where 'Temperature' matches 'Lower Than' '30'

And you will get the following result, where only the temperatures below 30°C are included:

**Transformed Data**


| Time | Temperature | Altitude | 
| --- | --- | --- | 
| 2020-07-07 11:34:22 | 28 | 125 | 
| 2020-07-07 11:34:21 | 26 | 110 | 
| 2020-07-07 11:34:20 | 23 | 98 | 
| 2020-07-07 10:31:22 | 20 | 85 | 
| 2020-07-07 09:30:57 | 19 | 101 | 

You can add more than one condition to the filter. For example, you might want to include the data only if the altitude is greater than 100. To do so, add that condition to the following configuration:
+ Filter type: 'Include' rows that 'Match All' conditions
+ Condition 1: Rows where 'Temperature' matches 'Lower' than '30'
+ Condition 2: Rows where 'Altitude' matches 'Greater' than '100'

When you have more than one condition, you can choose if you want the action (include/exclude) to be applied on rows that **Match all** conditions or **Match any** of the conditions you added.

In the example above, we chose **Match all** because we wanted to include the rows that have a temperature lower than 30°C *AND* an altitude higher than 100. If we wanted to include the rows that have a temperature lower than 30°C *OR* an altitude higher than 100 instead, then we would select **Match any**. This would include the first row in the original data, which has a temperature of 32°C (does not match the first condition) but an altitude of 101 (which matches the second condition), so it is included.

Conditions that are invalid or incompletely configured are ignored.

This versatile data filtering transformation lets you to selectively include or exclude data points based on specific conditions. Customize the criteria to tailor your data presentation to meet your unique analytical needs.

## Filter fields by name
<a name="v12-panels-xform-funcs-name"></a>

Use this transformation to remove parts of your query results. There are three ways to filter field names:
+ Enter a regular expression.
+ Manually select included fields.
+ Use a dashboard variable.

*Use a regular expression*

When you filter using a regular expression, field names that match the regular expression are included. For example, using the regular expression `'prod.*'` would return only the fields that start with `prod`

The regular expression can include an interpolated dashboard variable using the `${variableName}` syntax.

*Manually select included fields*

Select or deselect field names to remove them from the result. If a regular expression is also included, fields that are matched by the expression are included, even if they're unchecked.

*Use a dashboard variable*

Select **From variable** to let you select a dashboard variable that's used to include fields. By setting up a dashboard variable with multiple choices, the same fields can be displayed across multiple visualizations.

This transformation provides flexibility in tailoring your query results to focus on the specific fields you need for effective analysis and visualization.

## Format string
<a name="v12-panels-xform-funcs-string"></a>

Use this transformation to customize the output of a string field. This transformation has the following fields:
+ **Upper case** – Formats the entire string in uppercase characters.
+ **Lower case** – Formats the entire string in lowercase characters.
+ **Sentence case** – Formats the first character of the string in uppercase.
+ **Title case** – Formats the first character of each word in the string in uppercase.
+ **Pascal case** – Formats the first character of each word in the string in uppercase and doesn’t include spaces between words.
+ **Camel case** – Formats the first character of each word in the string in uppercase, except the first word, and doesn’t include spaces between words.
+ **Snake case** – Formats all characters in the string in lowercase and uses underscores instead of spaces between words.
+ **Kebab case** – Formats all characters in the string in lowercase and uses dashes instead of spaces between words.
+ **Trim** – Removes all leading and trailing spaces from the string.
+ **Substring** – Returns a substring of the string, using the specified start and end positions.

This transformation provides a convenient way to standardize and tailor the presentation of string data for better visualization and analysis.

**Note**  
This transformation is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

## Format time
<a name="v12-panels-xform-funcs-time"></a>

Use this transformation to customize the output of a time field. Output can be formatted using [Moment.js format strings](https://momentjs.com/docs/#/displaying/). For example, if you want to display only the year of a time field, the format string 'YYYY' can be used to show the calendar year (for example, 1999 or 2012).

**Before Transformation:**


| Timestamp | Event | 
| --- | --- | 
| 1636678740000000000 | System Start | 
| 1636678680000000000 | User Login | 
| 1636678620000000000 | Data Updated | 

**After applying 'YYYY-MM-DD HH:mm:ss':**


| Timestamp | Event | 
| --- | --- | 
| 2021-11-12 14:25:40 | System Start | 
| 2021-11-12 14:24:40 | User Login | 
| 2021-11-12 14:23:40 | Data Updated | 

This transformation lets you tailor the time representation in your visualizations, providing flexibility and precision in displaying temporal data.

**Note**  
This transformation is available in workspaces compatbile with Grafana v12 as an alpha feature.

## Group by
<a name="v12-panels-xform-funcs-group"></a>

This transformation groups the data by a specified field (column) value and processes calculations on each group. Select to see a list of calculation choices.

Here’s an example of original data.


| Time | Server ID | CPU Temperature | Server Status | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | server 1 | 80 | Shutdown | 
| 7/7/2020 11:34:20 AM | server 3 | 62 | OK | 
| 7/7/2020 10:32:20 AM | server 2 | 90 | Overload | 
| 7/7/2020 10:31:22 AM | server 3 | 55 | OK | 
| 7/7/2020 9:30:57 AM | server 3 | 62 | Rebooting | 
| 7/7/2020 9:30:05 AM | server 2 | 88 | OK | 
| 7/7/2020 9:28:06 AM | server 1 | 80 | OK | 
| 7/7/2020 9:25:05 AM | server 2 | 88 | OK | 
| 7/7/2020 9:23:07 AM | server 1 | 86 | OK | 

This transformation goes in two steps. First you specify one or multiple fields to group the data by. This will group all the same values of those fields together, as if you sorted them. For instance if we group by the Server ID field, then it would group the data this way:


| Time | Server ID | CPU Temperature | Server Status | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | server 1 | 80 | Shutdown | 
| 7/7/2020 9:28:06 AM | server 1 | 80 | OK | 
| 7/7/2020 9:23:07 AM | server 1 | 86 | OK | 
| 7/7/2020 10:32:20 AM | server 2 | 90 | Overload | 
| 7/7/2020 9:30:05 AM | server 2 | 88 | OK | 
| 7/7/2020 9:25:05 AM | server 2 | 88 | OK | 
| 7/7/2020 11:34:20 AM | server 3 | 62 | OK | 
| 7/7/2020 10:31:22 AM | server 3 | 55 | OK | 
| 7/7/2020 9:30:57 AM | server 3 | 62 | Rebooting | 

All rows with the same value of Server ID are grouped together.

After choosing which field you want to group your data by, you can add various calculations on the other fields, and apply the calculation to each group of rows. For instance, we could want to calculate the average CPU temperature for each of those servers. So we can add the *mean* calculation applied on the CPU Temperature field to get the following:


| Server ID | CPU Temperature (mean) | 
| --- | --- | 
| server 1 | 82 | 
| server 2 | 88.6 | 
| server 3 | 59.6 | 

And we can add more than one calculation. For instance:
+ For field Time, we can calculate the *Last* value, to know when the last data point was received for each server
+ For field Server Status, we can calculate the *Last* value to know what is the last state value for each server
+ For field Temperature, we can also calculate the *Last* value to know what is the latest monitored temperature for each server

We would then get:


| Server ID | CPU Temperature (mean) | CPU Temperature (last) | Time (last) | Server Status (last) | 
| --- | --- | --- | --- | --- | 
| server 1 | 82 | 80 | 7/7/2020 11:34:20 AM | Shutdown | 
| server 2 | 88.6 | 90 | 7/7/2020 10:32:20 AM | Overload | 
| server 3 | 59.6 | 62 | 7/7/2020 11:34:20 AM | OK | 

This transformation enables you to extract key information from your time series and display it in a convenient way.

## Grouping to matrix
<a name="v12-panels-xform-funcs-groupmatrix"></a>

Use this transformation to combine three fields—which are used as input for the **Column**, **Row**, and **Cell value** fields from the query output—and generate a matrix. The matrix is calculated as follows:

**Original data**


| Server ID | CPU Temperature | Server Status | 
| --- | --- | --- | 
| server 1 | 82 | OK | 
| server 2 | 88.6 | OK | 
| server 3 | 59.6 | Shutdown | 

We can generate a matrix using the values of `Server Status` as column names, the `Server ID` values as row names, and the `CPU Temperature` as content of each cell. The content of each cell will appear for the existing column (`Server Status`) and row combination (`Server ID`). For the rest of the cells, you can select which value to display between: **Null**, **True**, **False**, or **Empty**.

**Output**


| Server IDServer Status | OK | Shutdown | 
| --- | --- | --- | 
| server 1 | 82 |  | 
| server 2 | 88.6 |  | 
| server 3 |  | 59.6 | 

Use this transformation to construct a matrix by specifying fields from your query results. The matrix output reflects the relationships between the unique values in these fields. This helps you present complex relationships in a clear and structured matrix format.

## Group to nested table
<a name="v12-panels-xform-funcs-grouptable"></a>

Use this transformation to group the data by a specified field (column) value and process calculation on each group. Records are generated that share the same grouped field value, to be displayed in a nested table.

To calculate a statistic for a field, select the box next to the field and choose the **Calculate** option. This will add another selection box with statistics to be selected.

The following table shows sample data.


| Time | Server ID | CPU Temperature | Server Status | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | server 1 | 80 | Shutdown | 
| 7/7/2020 11:34:20 AM | server 3 | 62 | OK | 
| 7/7/2020 10:32:20 AM | server 2 | 90 | Overload | 
| 7/7/2020 10:31:22 AM | server 3 | 55 | OK | 
| 7/7/2020 9:30:57 AM | server 3 | 62 | Rebooting | 
| 7/7/2020 9:30:05 AM | server 2 | 88 | OK | 
| 7/7/2020 9:28:06 AM | server 1 | 80 | OK | 
| 7/7/2020 9:25:05 AM | server 2 | 88 | OK | 
| 7/7/2020 9:23:07 AM | server 1 | 86 | OK | 

This transformation has two steps. First, specify one or more fields by which to group the data. This groups all the same values of those fields together, as if you sorted them For instance, if you group by the `Server ID` field, Grafana groups the data this way:


| Server ID | Data | 
| --- | --- | 
| Time | CPU Temperature | Server Status | 
| --- | --- | --- | 
| Time | CPU Temperature | Server Status | 
| --- | --- | --- | 
| Time | CPU Temperature | Server Status | 
| --- | --- | --- | 
| server 1 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| server 2 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| server 3 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| 7/7/2020 11:34:20 AM | 80 | Shutdown | 
| 7/7/2020 9:28:06 AM | 80 | OK | 
| 7/7/2020 9:23:07 AM | 86 | OK | 
| 7/7/2020 10:32:20 AM | 90 | Overload | 
| 7/7/2020 9:30:05 AM | 88 | OK | 
| 7/7/2020 9:25:05 AM | 88 | OK | 
| 7/7/2020 11:34:20 AM | 62 | OK | 
| 7/7/2020 10:31:22 AM | 55 | OK | 
| 7/7/2020 9:30:57 AM | 62 | Rebooting | 

After choosing the field by which you want to group your data, you can add various calculations on the other fields and apply the calculation to each group of rows. For instance, you might want to calculate the average CPU temperature for each of those servers. To do so, add the mean calculation applied on the CPU Temperature field to get the following result:


| Server ID | CPU Temperatute (mean) |  | 
| --- | --- | --- | 
| Time | Server Status | 
| --- | --- | 
| Time | Server Status | 
| --- | --- | 
| Time | Server Status | 
| --- | --- | 
| server 1 | 82 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| server 2 | 88.6 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| server 3 | 59.6 | [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/grafana/latest/userguide/v12-panels-xform-functions.html) | 
| 7/7/2020 11:34:20 AM | Shutdown | 
| 7/7/2020 9:28:06 AM | OK | 
| 7/7/2020 9:23:07 AM | OK | 
| 7/7/2020 10:32:20 AM | Overload | 
| 7/7/2020 9:30:05 AM | OK | 
| 7/7/2020 9:25:05 AM | OK | 
| 7/7/2020 11:34:20 AM | OK | 
| 7/7/2020 10:31:22 AM | OK | 
| 7/7/2020 9:30:57 AM | Rebooting | 

## Create heatmap
<a name="v12-panels-xform-funcs-heatmap"></a>

Use this transformation to prepare histogram data for visualizing trends over time. Similar to the heatmap visualization, this transformation converts histogram metrics into temporal buckets.

**X Bucket**

This setting determines how the x-axis is split into buckets.
+ **Size** – Specify a time interval in the input field. For example, a time range of `1h` creates cells one hour wide on the x-axis.
+ **Count** – For non-time-related series, use this option to define the number of elements in a bucket.

**Y Bucket**

This setting determines how the y-axis is split into buckets.
+ **Linear**
+ **Logarithmic** – Choose between log base 2 or log base 10.
+ **Symlog** – Uses a symmetrical logarithmic scale. Choose between log base 2 or log base 10, allowing for negative values.

Assume you have the following dataset:


| Timestamp | Value | 
| --- | --- | 
| 2023-01-01 12:00:00 | 5 | 
| 2023-01-01 12:15:00 | 10 | 
| 2023-01-01 12:30:00 | 15 | 
| 2023-01-01 12:45:00 | 8 | 
+ With X Bucket set to `Size: 15m` and Y Bucket as `Linear`, the histogram organizes values into time intervals of 15 minutes on the x-axis and linearly on the y-axis.
+ For X Bucket as `Count: 2` and Y Bucket as `Logarithmic (base 10)`, the histogram groups values into buckets of two on the x-axis and use a logarithmic scale on the y-axis.

## Histogram
<a name="v12-panels-xform-funcs-histogram"></a>

Use this transformation to generate a histogram based on input data, allowing you to visualize the distribution of values.
+ **Bucket size** – The range between the lowest and highest items in a bucket (xMin to xMax).
+ **Bucket offset** – The offset for non-zero-based buckets.
+ **Combine series** – Create a unified histogram using all available series.

**Original data**

Series 1:


| A | B | C | 
| --- | --- | --- | 
| 1 | 3 | 5 | 
| 2 | 4 | 6 | 
| 3 | 5 | 7 | 
| 4 | 6 | 8 | 
| 5 | 7 | 9 | 

Series 2:


| C | 
| --- | 
| 5 | 
| 6 | 
| 7 | 
| 8 | 
| 9 | 

**Output**


| xMin | xMax | A | B | C | C | 
| --- | --- | --- | --- | --- | --- | 
| 1 | 2 | 1 | 0 | 0 | 0 | 
| 2 | 3 | 1 | 0 | 0 | 0 | 
| 3 | 4 | 1 | 1 | 0 | 0 | 
| 4 | 5 | 1 | 1 | 0 | 0 | 
| 5 | 6 | 1 | 1 | 1 | 1 | 
| 6 | 7 | 0 | 1 | 1 | 1 | 
| 7 | 8 | 0 | 1 | 1 | 1 | 
| 8 | 9 | 0 | 0 | 1 | 1 | 
| 9 | 10 | 0 | 0 | 1 | 1 | 

Visualize the distribution of values using the generated histogram, providing insights into the data’s spread and density.

## Join by field
<a name="v12-panels-xform-funcs-joinfield"></a>

Use this transformation to merge multiple results into a single table, enabling the consolidation of data from different queries.

The is especially useful for converting multiple time series results into a single wide table with a shared time field.

**Inner join**

An inner join merges data from multiple tables where all tables share the same value from the selected field. This type of join excludes data where values do not match in every result.

Use this transformation to combine the results from multiple queries (combining on a passed join field or the first time column) into one result, and drop rows where a successful join cannot occur.

In the following example, two queries return table data. It is visualized as two separate tables before applying the inner join transformation.

Query A:


| Time | Job | Uptime | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 25260122 | 
| 7/7/2020 11:24:20 AM | postgre | 123001233 | 
| 7/7/2020 11:14:20 AM | postgre | 345001233 | 

Query B:


| Time | Server | Errors | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | server 1 | 15 | 
| 7/7/2020 11:24:20 AM | server 2 | 5 | 
| 7/7/2020 11:04:20 AM | server 3 | 10 | 

The result after applying the inner join transformation looks like the following:


| Time | Job | Uptime | Server | Errors | 
| --- | --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 25260122 | server 1 | 15 | 
| 7/7/2020 11:24:20 AM | postgre | 123001233 | server 2 | 5 | 

*Outer join*

An outer join includes all data from an inner join and rows where values do not match in every input. While the inner join joins Query A and Query B on the time field, the outer join includes all rows that don’t match on the time field.

In the following example, two queries return table data. It is visualized as two tables before applying the outer join transformation.

Query A:


| Time | Job | Uptime | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 25260122 | 
| 7/7/2020 11:24:20 AM | postgre | 123001233 | 
| 7/7/2020 11:14:20 AM | postgre | 345001233 | 

Query B:


| Time | Server | Errors | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | server 1 | 15 | 
| 7/7/2020 11:24:20 AM | server 2 | 5 | 
| 7/7/2020 11:04:20 AM | server 3 | 10 | 

The result after applying the outer join transformation looks like the following:


| Time | Job | Uptime | Server | Errors | 
| --- | --- | --- | --- | --- | 
| 7/7/2020 11:04:20 AM |  |  | server 3 | 10 | 
| 7/7/2020 11:14:20 AM | postgre | 345001233 |  |  | 
| 7/7/2020 11:34:20 AM | node | 25260122 | server 1 | 15 | 
| 7/7/2020 11:24:20 AM | postgre | 123001233 | server 2 | 5 | 

## Join by labels
<a name="v12-panels-xform-funcs-joinlabel"></a>

Use this transformation to join multiple results into a single table.

This is especially useful for converting multiple time series results into a single wide table with a shared **Label** field.
+ **Join** – Select the label to join by between the labels available or common across all time series.
+ **Value** – The name for the output result.

**Example**

Input 1: `series1{what='Temp', cluster='A', job='J1'}`


| Time | Value | 
| --- | --- | 
| 1 | 10 | 
| 2 | 200 | 

Input 2: `series2{what='Temp', cluster='B', job='J1'}`


| Time | Value | 
| --- | --- | 
| 1 | 10 | 
| 2 | 200 | 

Input 3: `series3{what='Speed', cluster='B', job='J1'}`


| Time | Value | 
| --- | --- | 
| 22 | 22 | 
| 28 | 77 | 

Config:

```
value: 'what'
```

Output:


| cluster | job | Temp | Speed | 
| --- | --- | --- | --- | 
| A | J1 | 10 |  | 
| A | J1 | 200 |  | 
| B | J1 | 10 | 22 | 
| B | J1 | 200 | 77 | 

Combine and organize time series data effectively with this transformation for comprehensive insights.

## Labels to fields
<a name="v12-panels-xform-funcs-labelstofields"></a>

Use this transformation to convert time series results with labels or tags into a table, including each label's keys and values in the result. Display labels as either columns or row values for enhanced data visualization.

Given a query result of two time series:
+ Series 1 – labels `Server=Server A`, `Datacenter=EU`
+ Series 2 – labels `Server=Server B`, `Datacenter=EU`

In **Columns** mode, the result looks like this:


| Time | Server | Datacenter | Value | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | Server A | EU | 1 | 
| 7/7/2020 11:34:20 AM | Server B | EU | 2 | 

In “Rows” mode, the result has a table for each series and show each label value like this:


| label | value | 
| --- | --- | 
| Server | Server A | 
| Datacenter | EU | 


| label | value | 
| --- | --- | 
| Server | Server B | 
| Datacenter | EU | 

**Value field name**

If you selected Server as the **Value field name**, then you would get one field for every value of the Server label.


| Time | Datacenter | Server A | Server B | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | EU | 1 | 2 | 

**Merging behavior**

The labels to fields transformer is internally two separate transformations. The first acts on single series and extracts labels to fields. The second is the merge transformation that joins all the results into a single table. The merge transformation tries to join on all matching fields. This merge step is required and cannot be turned off.

To illustrate this, here is an example where you have two queries that return time series with no overlapping labels.
+ Series 1 – labels `Server=ServerA`
+ Series 2 – labels `Datacenter=EU`

This will first result in these two tables:


| Time | Server | Value | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | ServerA | 10 | 


| Time | Datacenter | Value | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | EU | 20 | 

After merge:


| Time | Server | Value | Datacenter | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | ServerA | 10 |  | 
| 7/7/2020 11:34:20 AM |  | 20 | EU | 

## Limit
<a name="v12-panels-xform-funcs-limit"></a>

Use this transformation to restrict the number of rows displayed, providing a more focused view of your data. This is particularly useful when dealing with large datasets.

The following is an example illustrating the impact of the **Limit** transformation on a response from a data source:


| Time | Metric | Value | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | Temperature | 25 | 
| 7/7/2020 11:34:20 AM | Humidity | 22 | 
| 7/7/2020 10:32:20 AM | Humidity | 29 | 
| 7/7/2020 10:31:22 AM | Temperature | 22 | 
| 7/7/2020 9:30:57 AM | Humidity | 33 | 
| 7/7/2020 9:30:05 AM | Temperature | 19 | 

Here is the result after adding a Limit transformation with a value of ‘3’:


| Time | Metric | Value | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | Temperature | 25 | 
| 7/7/2020 11:34:20 AM | Humidity | 22 | 
| 7/7/2020 10:32:20 AM | Humidity | 29 | 

This transformation helps you tailor the visual presentation of your data to focus on the most relevant data.

## Merge series/tables
<a name="v12-panels-xform-funcs-merge"></a>

Use this transformation to combine the result from multiple queries into a single result, which is particularly useful when using the table panel visualization. The transformation merges values into the same row if shared fields contain the same data.

Here's an exampleillustration the impact of the **Merge series/tables** transformation on two queries returning table data:

*Query A:*


| Time | Job | Uptime | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 25260122 | 
| 7/7/2020 11:24:20 AM | postgre | 123001233 | 

Query B:


| Time | Job | Errors | 
| --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 15 | 
| 7/7/2020 11:24:20 AM | postgre | 5 | 

Here is the result after applying the Merge transformation:


| Time | Job | Errors | Uptime | 
| --- | --- | --- | --- | 
| 7/7/2020 11:34:20 AM | node | 15 | 25260122 | 
| 7/7/2020 11:24:20 AM | postgre | 5 | 123001233 | 

This transformation combines values from Query A and Query B into a unified table, enhancingthe presentation for better insights.

## Organize fields by name
<a name="v12-panels-xform-funcs-organize"></a>

Use this transformation to rename, reorder, or hide fields returned by a single query in your panel. This transformation only works in panels with a single query. If your panel has multiple queries, then you must either apply an *Outer join* transformation or remove the extra queries.

**Transforming fields**

Grafana displays a list of fields returned by the query. You can:
+ **Change field order** – Drag a field to a new location in the list.
+ **Hide or show a field** – Use the eye icon next to the field name to toggle the visibility of a field.
+ **Rename fields** – Type a new name into the **Rename** box.

**Example**

Given this initial query result:


| Time | Metric | Value | 
| --- | --- | --- | 
| 2020-07-07 11:34:20 | Temperature | 25 | 
| 2020-07-07 11:34:20 | Humidity | 22 | 
| 2020-07-07 10:32:20 | Humidity | 29 | 

You could apply a rename field override to create:


| Time | Sensor | Reading | 
| --- | --- | --- | 
| 2020-07-07 11:34:20 | Temperature | 25 | 
| 2020-07-07 11:34:20 | Humidity | 22 | 
| 2020-07-07 10:32:20 | Humidity | 29 | 

This transformation lets you tailor the display of query results, ensuring a clear and insightful representation of your data in Grafana.

## Partition by values
<a name="v12-panels-xform-funcs-partition"></a>

Use this transformation to streamline the process of graphing multiple series without the need for multiple queries with different `WHERE` clauses.

**Note**  
This function is available in workspaces compatible with Grafana version 9 and above.

This is particularly useful when using a metrics SQL table, as in this example:


| Time | Region | Value | 
| --- | --- | --- | 
| 10/20/2022 12:00:00 PM | US | 1520 | 
| 10/20/2022 12:00:00 PM | EU | 2936 | 
| 10/20/2022 1:00:00 AM | US | 1327 | 
| 10/20/2022 1:00:00 AM | EU | 912 | 

With the *Partition by values* transformer, you can issue a single query and split the results by unique values in one or more columns (fields) of your choosing. The following example uses `Region`.

```
SELECT Time, Region, Value FROM metrics WHERE Time > '2022-10-20'
```


| Time | Region | Value | 
| --- | --- | --- | 
| 10/20/2022 12:00:00 PM | US | 1520 | 
| 10/20/2022 1:00:00 AM | US | 1327 | 


| Time | Region | Value | 
| --- | --- | --- | 
| 10/20/2022 12:00:00 PM | EU | 2936 | 
| 10/20/2022 1:00:00 AM | EU | 912 | 

This transformation simplifies the process and enhances the flexibility of visualizing multiple series within the same time series visualization.

## Prepare times series
<a name="v12-panels-xform-funcs-preparetimeseries"></a>

Use this transformation to address issues when a data source returns time series data in a format that isn’t compatible with the desired visualization. This transformation allows you to convert time series data from between wide and long formats.

**Multi-frame time series**

Use this option to transform the time series data frame from the wide format to the long format. This is particularly helpful when your data source delivers time series information in a format that needs to be reshaped for optimal compatibility with your visualization.

*Example*

This input:


| Timestamp | Value1 | Value2 | 
| --- | --- | --- | 
| 2023-01-01 00:00:00 | 10 | 20 | 
| 2023-01-01 01:00:00 | 15 | 25 | 

Could be transformed to:


| Timestamp | Variable | Value | 
| --- | --- | --- | 
| 2023-01-01 00:00:00 | Value1 | 10 | 
| 2023-01-01 00:00:00 | Value2 | 20 | 
| 2023-01-01 01:00:00 | Value1 | 15 | 
| 2023-01-01 01:00:00 | Value2 | 25 | 

**Wide time series**

Use this option to transform the time series data frame from the long format to the wide format. This is particularly helpful when your data source delivers time series data in a long format and your visualization requires a wide format.

*Example*

This input:


| Timestamp | Variable | Value | 
| --- | --- | --- | 
| 2023-01-01 00:00:00 | Value1 | 10 | 
| 2023-01-01 00:00:00 | Value2 | 20 | 
| 2023-01-01 01:00:00 | Value1 | 15 | 
| 2023-01-01 01:00:00 | Value2 | 25 | 

Could be transformed to:


| Timestamp | Value1 | Value2 | 
| --- | --- | --- | 
| 2023-01-01 00:00:00 | 10 | 20 | 
| 2023-01-01 01:00:00 | 15 | 25 | 

## Reduce
<a name="v12-panels-xform-funcs-reduce"></a>

Use this transformation applies a calculation to each field in the data frame and return a single value. This transformation is particularly useful for consolidating mulitiple time series data into a more compact, summarized format. Time fields are removed when applying this transformation.

Consider the input:

Query A:


| Time | Temp | Uptime | 
| --- | --- | --- | 
| 2020-07-07 11:34:20 | 12.3 | 256122 | 
| 2020-07-07 11:24:20 | 15.4 | 1230233 | 

Query B:


| Time | AQI | Errors | 
| --- | --- | --- | 
| 2020-07-07 11:34:20 | 6.5 | 15 | 
| 2020-07-07 11:24:20 | 3.2 | 5 | 

The reduce transformer has two modes:
+ **Series to rows** – Creates a row for each field and a column for each calculation.
+ **Reduce fields** – Keeps the existing frame structure, but collapses each field into a single value.

For example, if you used the **First** and **Last** calculation with a **Series to rows** transformation, then the result wouldbe:


| Field | First | Last | 
| --- | --- | --- | 
| Temp | 12.3 | 15.4 | 
| Uptime | 256122 | 1230233 | 
| AQI | 6.5 | 3.2 | 
| Errors | 15 | 5 | 

The **Reduce fields** with the **Last** calculation, results in two frames, each with one row:

Query A:


| Temp | Uptime | 
| --- | --- | 
| 15.4 | 1230233 | 

Query B:


| AQI | Errors | 
| --- | --- | 
| 3.2 | 5 | 

## Rename by regex
<a name="v12-panels-xform-funcs-rename"></a>

Use this transformation to rename parts of the query results using a regular expression and replacement pattern.

You can specify a regular expression, which is only applied to matches, along with a replacement pattern that support back references. For example, let’s imagine you’re visualizing CPU usage per host and you want to remove the domain name. You could set the regex to `([^\.]+)\..+` and the replacement pattern to `$1`, `web-01.example.com` would become `web-01`.

This transformation lets you tailor your data to meet your visualization needs, making your dashboards more informative and user-friendly.

## Rows to fields
<a name="v12-panels-xform-funcs-row"></a>

Use this transformation to convert rows into separate fields. This can be useful because fields can be styled and configured individually. It can also use additional fields as sources for dynamic field configuration or map them to field labels. The additional labels can then be used to define better display names for the resulting fields.

This transformation includes a field table which lists all fields in the data returned by the configuration query. This table gives you control over what field should be mapped to each configuration property (the **Use as** option). You can also choose which value to select if there are multiple rows in the returned data.

This transformation requires:
+ One field to use as the source of field names.

  By default, the transform uses the first string field as the source. You can override this default setting by selecting **Field name** in the **Use as** column for the field you want to use instead.
+ One field to use as the source of values.

  By default, the transform uses the first number field as the source. But you can override this default setting by selecting **Field value** in the **Use as** column for the field you want to use instead.

Useful when visualizing data in:
+ Gauge
+ Stat
+ Pie chart

**Map extra fields to labels**

If a field does not map to config property Grafana will automatically use it as source for a label on the output field.

Example:


| Name | DataCenter | Value | 
| --- | --- | --- | 
| ServerA | US | 100 | 
| ServerB | EU | 200 | 

Output:


| ServerA (labels: DataCenter: US) | ServerB (labels: DataCenter: EU) | 
| --- | --- | 
| 100 | 200 | 

The extra labels can now be used in the field display name to provide more complete field names.

If you want to extract config from one query and apply it to another you should use the *config from query results* transformation.

**Example**

Input:


| Name | Value | Max | 
| --- | --- | --- | 
| ServerA | 10 | 100 | 
| ServerB | 20 | 200 | 
| ServerC | 30 | 300 | 

Output:


| ServerA (config: max=100) | ServerB (config: max=200) | ServerC (config: max=300) | 
| --- | --- | --- | 
| 10 | 20 | 30 | 

As you can see each row in the source data becomes a separate field. Each field now also has a max config option set. Options like **Min**, **Max**, **Unit** and **Thresholds** are all part of field configuration and if set like this will be used by the visualization instead of any options manually configured in the panel editor options pane.

This transformation enables the conversion of rows into individual fields, facilitates dynamic field configuration, and maps additional fields to labels.

## Series to rows
<a name="v12-panels-xform-funcs-series"></a>

Use this transformation to combine the result from multiple time series data queries into one single result. This is helpful when using the table panel visualization.

The result from this transformation will contain three columns: Time, Metric, and Value. The Metric column is added so you easily can see from which query the metric originates from. Customize this value by defining Label on the source query.

In the example below, we have two queries returning time series data. It is visualized as two separate tables before applying the transformation.

*Query A:*


| Time | Temperature | 
| --- | --- | 
| 2020-07-07 11:34:20 | 25 | 
| 2020-07-07 10:31:22 | 22 | 
| 2020-07-07 09:30:05 | 19 | 

*Query B:*


| Time | Humidity | 
| --- | --- | 
| 2020-07-07 11:34:20 | 24 | 
| 2020-07-07 10:32:20 | 29 | 
| 2020-07-07 09:30:57 | 33 | 

Here is the result after applying the Series to rows transformation.


| Time | Metric | Value | 
| --- | --- | --- | 
| 2020-07-07 11:34:20 | Temperature | 25 | 
| 2020-07-07 11:34:20 | Humidity | 22 | 
| 2020-07-07 10:32:20 | Humidity | 29 | 
| 2020-07-07 10:31:22 | Temperature | 22 | 
| 2020-07-07 09:30:57 | Humidity | 33 | 
| 2020-07-07 09:30:05 | Temperature | 19 | 

This transformation facilitates the consolidation of results from multiple time series queries, providing a streamlined and unified dataset for efficient analysis and visualization in a tabular format.

## Sort by
<a name="v12-panels-xform-funcs-sort"></a>

Use this transformation to sort each frame within a query result based on a specified field, making your data easier to understand and analyze. By configuring the desired field for sorting, you can control the order in which the data is presented in the table or visualization.

Use the **Reverse** switch to inversely order the values within the specified field. This functionality is particularly useful when you want to quickly toggle between ascending and descending order to suit your analytical needs.

For example, in a scenario where time-series data is retrieved from a data source, the **Sort by** transformation can be applied to arrange the data frames based on the timestamp, either in ascending or descending order, depending on the analytical requirements. This capability ensures that you can easily navigate and interpret time-series data, gaining valuable insights from the organized and visually coherent presentation.

## Spatial
<a name="v12-panels-xform-funcs-spatial"></a>

Use this transformation to apply spatial operations to query results.
+ **Action** – Select an action:
  + **Prepare spatial field** – Set a geometry field based on the results of other fields.
    + **Location mode** – Select a location mode (these options are shared by the **Calculate value** and **Transform** modes):
      + **Auto** – Automatically identify location data based on default field names.
      + **Coords** – Specify latitude and longitude fields.
      + **Geohash** – Specify a geohash field.
      + **Lookup** – Specify Gazetteer location fields.
  + **Calculate value** – Use the geometry to define a new field (heading/distance/area).
    + **Function** – Choose a mathematical operation to apply to the geometry:
      + **Heading** – Calculate the heading (direction) between two points.
      + **Area** – Calculate the area enclosed by a polygon defined by the geometry.
      + **Distance** – Calculate the distance between two points.
  + **Transform** – Apply spatial operations to the geometry.
    + **Operation** – Choose an operation to apply to the geometry:
      + **As line** – Create a single line feature with a vertex at each row.
      + **Line builder** – Create a line between two points.

This transformation allows you to manipulate and analyze geospatial data, enabling operations such as creating lines between points, calculating spatial properties, and more.

## Time series to table transform
<a name="v12-panels-xform-funcs-seriestotable"></a>

Use this transformation to convert time series results into a table, transforming a time series data frame into a **Trend** field. The **Trend** field can then be rendered using the [sparkline cell type](v12-panels-table.md#v12-panels-table-cell-type), generating an inline sparkline for each table row. If there are multiple time series queries, each will result in a separate table data frame. These can be joined using join or merge transforms to produce a single table with multiple sparklines per row.

For each generated **Trend** field value, a calculation function can be selected. The default is **Last non-null value**. This value is displayed next to the sparkline and used for sorting table rows.

## Regression analysis
<a name="v12-panels-xform-funcs-regression"></a>

Use this transformation to create a new data frame containing values predicted by a statistical model. This is useful for finding a trend in chaotic data. It works by fitting a mathematical function to the data, using either linear or polynomial regression. The data frame can then be used in a visualization to display a trendline.

There are two different models:
+  **Linear regression** – Fits a linear function to the data.
+  **Polynomial regression** – Fits a polynomial function to the data.

**Note**  
This transformation is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

# Troubleshoot queries
<a name="v12-panels-query-troubleshoot"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

This page provides information to solve common dashboard problems.

**I get different results when I rearrange my functions**

Function order is very important. Just like in math, the order that you place your functions can affect the result.

**Inspect your query request and response**

The most common problems are related to the query and response from your data source. Even if it looks like a bug or visualization issue in Grafana, it is almost always a problem with the data source query or the data source response. Start by inspecting your panel query and response.

For more information, refer to [Inspect request and response data](v12-panels-panel-inspector.md).

**My query is slow**

How many data points is your query returning? A query that returns lots of data points will be slow. Try this:
+ In **Query options**, limit the **Max data points** returned.
+ In **Query options**, increase the **Min interval** time.
+ In your query, use a `group by` function.

# Calculation types
<a name="v12-panels-calculation-types"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The following table contains a list of calculations you can perform in Grafana. You can find these calculations in the **Transform** tab and in the bar gauge, gauge, and stat visualizations.


| Calculation | Description | 
| --- | --- | 
| All nulls | True when all values are null | 
| All values | Array with all values | 
| All unique values | Array with all unique values | 
| All zeros | True when all values are 0 | 
| Change count | Number of times the field’s value changes | 
| Count | Number of values in a field | 
| Delta | Cumulative change in value, only counts increments | 
| Difference | Difference between first and last value of a field | 
| Difference percent | Percentage change between first and last value of a field | 
| Distinct count | Number of unique values in a field | 
| First | First value in a field | 
| First\$1 (not null) | First, not null value in a field (also excludes NaNs) | 
| Last | Last value in a field | 
| Last\$1 (not null) | Last, not null value in a field (also excludes NaNs) | 
| Max | Maximum value of a field | 
| Mean | Mean value of all values in a field | 
| Variance | Variance of all values in a field | 
| StdDev | Standard deviation of all values in a field | 
| Min | Minimum value of a field | 
| Min (above zero) | Minimum, positive value of a field | 
| Range | Difference between maximum and minimum values of a field | 
| Step | Minimal interval between values of a field | 
| Total | Sum of all values in a field | 

# Configure panel options
<a name="v12-panels-configure-panel-options"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A Grafana panel is a visual representation of data that you can customize by defining a data source query, transforming and formatting data, and configuring visualization settings.

A panel editor includes a query builder and a series of options that you can use to transform data and add information to your panels.

This topic describes how to:
+ Open a panel for editing
+ Add a panel title and description
+ View a panel JSON model
+ Configure repeating rows and panels

## Editing a panel
<a name="v12-panels-edit-a-panel"></a>

After you add a panel to a dashboard, you can open it at any time to change or update queries, add data transformation, and change visualization settings.

**To edit a panel**

1. Open the dashboard that contains the panel you want to edit.

1. Hover over any part of the panel to display the actions menu in the top right corner.

1. Choose the menu and select **Edit**.

   To use a keyboard shortcut to open the panel, hover over the panel and press `e`.

   The panel opens in edit mode.

## Add a title and description to a panel
<a name="v12-panels-add-title-description"></a>

Add a title and description to a panel to share with users any important information about the visualization. For example, use the description to document the purpose of the visualization.

1. Edit a panel.

1. In the panel display options pane, locate the **Panel options** section.

1. Enter a **Title**.

   Text entered in this field appears in a tooltip in the panel editor and in the dashboard.

1. Write a description of the panel and the data you are displaying.

   Text entered in this field appears in a tooltip in the upper-left corner of the panel.

   You can use [variables you have defined](v12-dash-variables.md) in the **Title** and **Description** field, but not [global variables](v12-dash-variable-add.md#v12-dash-variable-add-global).

## Viewing a panel JSON model
<a name="v12-panels-json-model"></a>

Explore and export panel, panel data, and data frame JSON models.

**To view a panel JSON model**

1. Open the dashboard that contains the panel.

1. Hover over any part of the panel to display the actions menu on the top right corner.

1. From the menu, select **Inspect > Panel JSON**.

1. In the **Select source** field, choose one of the following options:
   + **Panel JSON** – Displays a JSON object representing the panel.
   + **Panel data** – Displays a JSON object representing the data that was passed to the panel.
   + **DataFrame structure** – Displays the data structure of the panel, including any transformations, field configurations, and override configurations that have been applied.

1. To explore the JSON, choose **>** to expand or collapse portions of the JSON model.

## Configuring repeating panels
<a name="v12-panels-configure-repeating-panels"></a>

You can configure Grafana to dynamically add panels or rows to a dashboard. A dynamic panel is a panel that the system creates based on the value of a variable. Variables dynamically change your queries across all panels in a dashboard. For more information about repeating panels, see [Creating dashboards](v12-dash-creating.md).

**Note**  
Repeating panels require variables to have one or more items selected; you cannot repeat a panel zero times to hide it.

*Prequisites*
+ Ensure that the query includes a multi-value variable.

**To configure repeating panels**

1. Edit the panel you want to repeat.

1. On the display options pane, choose **Panel options > Repeat options**.

1. Select a **direction**.
   + Choose **horizontal** to arrange panels side-by-side. Grafana adjusts the width of a repeated panel. You cannot mix other panels on a row with a repeated panel.
   + Choose **vertical** to arrange panels in a column. The width of repeated panels is the same as the original, repeated panel.

1. To propagate changes to all panels, reload the dashboard.

# Configure standard options
<a name="v12-panels-configure-standard-options"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The data model used in Grafana is a columnar-oriented table structure that unifies both time series and table query results. Each column within this structure is called a *field*. A field can represent a single time series or table column.

Field options allow you to change how the data is displayed in your visualizations. Options and overrides that you apply do not change the data, they change how Grafana displays the data. When you change an option, it is applied to all fields, meaning all series or columns. For example, if you change the unit to percentage, then all fields with numeric values are displayed in percentages.

A complete list of field formatting options is included later in this topic.

**Note**  
You can apply standard options to most built-in Grafana panels. Some older panels and community panels that have not updated to the new panel and data model will be missing either all or some of these field options.

**To configure standard options**

1. Open a dashboard. Hover over any part of the panel to display the actions menu at the top right corner of the dashboard.

1. From the actions menu, choose **Edit**.

1. In the panel display options pane, locate the **Standard options** section.

1. Select the standard options you want to apply.

1. To preview your change, select outside of the field option box you are editing or press **Enter**.

**Standard options definitions**

This section explains all available standard options.

You can apply standard options to most built-in Grafana panels. Some older panels and community panels that have not updated to the new panel and data model will be missing either all or some of these field options.

Most field options will not affect the visualization until you click outside of the field option box you are editing or press **Enter**.

**Note**  
Grafana Labs is constantly working to add and expand options for all visualization, so all options might not be available for all visualizations.

## Unit
<a name="v12-panels-standard-options-unit"></a>

Lets you choose what unit a field should use. Choose the **Unit** field, then drill down until you find the unit you want. The unit you select is applied to all fields except time.

### Custom units
<a name="v12-panels-standard-options-custom-units"></a>

You can use the unit dropdown to also specify custom units, custom prefix or suffix and date time formats.

To select a custom unit enter the unit and select the last **Custom: xxx** option in the dropdown.
+ **suffix:<suffix>** for a custom unit that should go after the value.
+ **prefix:<prefix>** for a custom unit that should go before the value.
+ **time:<format>** For custom date time formats, type for example `time:YYYY-MM-DD`. See [format](https://momentjs.com/docs/#/displaying/) in the *Moment.js Documentation* for the format syntax and options.
+ **si:<base scale><unit characters>** for custom SI units. For example: `si: mF`. This is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.
+ **count:<unit>** for a custom count unit.
+ **currency:<unit>** for custom a currency unit.

You can also paste a native emoji in the unit picker and pick it as a custom unit.

### String units
<a name="v12-panels-standard-options-string-units"></a>

Grafana can sometimes be too aggressive in parsing strings and displaying them as numbers. To configure Grafana to show the original string value, create a field override and add a unit property with the **String** unit.

### Scale units
<a name="v12-panels-standard-options-scale-units"></a>

By default, Grafana automatically scales the unit based on the magnitude of the value. For example, if you have a value of 0.14 kW, Grafana will display it as 140 W. Another example is that 3000 kW will be displayed as three MW. If you want to disable this behavior, you can turn off the **Scale units** switch.

## Min
<a name="v12-panels-standard-options-min"></a>

Lets you set the minimum value used in percentage threshold calculations. Leave blank to automatically calculate the minimum.

## Max
<a name="v12-panels-standard-options-max"></a>

Lets you set the maximum value used in percentage threshold calculations. Leave blank to automatically calculate the maximum.

## Field min/max
<a name="v12-panels-standard-options-fieldminmax"></a>

By default the calculated min and max will be based on the minimum and maximum, in all series and fields. Turning field min/max on will calculate the min or max on each field individually, based on the minimum or maximum of that field.

## Decimals
<a name="v12-panels-standard-options-decimals"></a>

Specify the number of decimals Grafana includes in the rendered value. If you leave this field blank, Grafana automatically truncates the number of decimals based on the value. For example 1.1234 will display as 1.12 and 100.456 will display as 100.

To display all decimals, set the unit to **String**.

## Display name
<a name="v12-panels-standard-options-displayname"></a>

Lets you set the display title of all fields. You can use [variables](v12-dash-variables.md) in the field title.

When multiple stats, fields, or series are shown, this field controls the title in each stat. You can use expressions like **\$1\$1\$1\$1field.name\$1** to use only the series name or the field name in the title.

Given a field with a name of `Temp`, and labels of `{"Loc"="PBI", "Sensor"="3"}`:


| Expression syntax | Example | Renders to | Explanation | 
| --- | --- | --- | --- | 
| \$1\$1\$1\$1field.displayName\$1 | Same as syntax | Temp \$1Loc="PBI", Sensor="3"\$1 | Displays the field name, and labels in \$1\$1 if they are present. If there is only one label key in the response, then for the label portion, Grafana displays the value of the label without the enclosing braces. | 
| \$1\$1\$1\$1field.name\$1 | Same as syntax | Temp | Displays the name of the field (without labels). | 
| \$1\$1\$1\$1field.labels\$1 | Same as syntax | Loc="PBI", Sensor="3" | Displays the labels without the name. | 
| \$1\$1\$1\$1field.labels.X\$1 | \$1\$1\$1\$1field.labels.Loc\$1 | PBI | Displays the value of the specified label key. | 
| \$1\$1\$1\$1field.labels.\$1\$1values\$1 | Same as Syntax | PBI, 3 | Displays the values of the labels separated by a comma (without label keys). | 

If the value is an empty string after rendering the expression for a particular field, then the default display method is used.

## Color scheme
<a name="v12-panels-standard-options-color-scheme"></a>

The color options and their effect on the visualization depends on the visualization you are working with. Some visualizations have different color options.

You can specify a single color, or select a continuous (gradient) color scheme, based on a value. Continuous color interpolates a color using the percentage of a value relative to min and max.

Select one of the following palettes:


| Color mode | Description | 
| --- | --- | 
| Single color | Specify a single color, useful in an override rule | 
| Shades of a color | Selects shades of a single color, useful in an override rule | 
| From thresholds | Informs Grafana to take the color from the matching threshold | 
| Classic palette | Grafana will assign color by looking up a color in a palette by series index. Useful for Graphs and pie charts and other categorical data visualizations | 
| Classic palette (by series name) | Grafana will assign color based on the name of the series. Useful when the series names to be vsiualized depend on the available data. | 
| Green-Yellow-Red (by value) | Continuous color scheme | 
| Red-Yellow-Green (by value) | Continuous color scheme | 
| Blue-Yellow-Red (by value) | Continuous color scheme | 
| Yellow-Red (by value) | Continuous color scheme | 
| Blue-Purple (by value) | Continuous color scheme | 
| Yellow-Blue (by value) | Continuous color scheme | 
| Blues (by value) | Continuous color scheme (panel background to blue) | 
| Reds (by value) | Continuous color scheme (panel background color to red) | 
| Greens (by value) | Continuous color scheme (panel background color to green) | 
| Purple (by value) | Continuous color scheme (panel background color to purple) | 

## No value
<a name="v12-panels-standard-options-no-value"></a>

Enter what Grafana should display if the field value is empty or null. The default value is a hyphen (-).

# Configure a legend
<a name="v12-panels-configure-legend"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

A panel includes a legend that you can use to interpret data displayed in a visualization. Each legend option adds context and clarity to the data illustrated in a visualization.

Legends are supported for the following visualizations:
+ [Bar chart](v12-panels-bar-chart.md)
+ [Candlestick](v12-panels-candlestick.md)
+ [Histogram](v12-panels-histogram.md)
+ [Pie chart](v12-panels-piechart.md)
+ [State timeline](v12-panels-state-timeline.md)
+ [Status history](v12-panels-status-history.md)
+ [Time series](v12-panels-time-series.md)
+ [Trend](v12-panels-trend.md)

[Geomaps](v12-panels-geomap.md) and [Heatmaps](v12-panels-heatmap.md) also have legends, but they only provide the choice to display or not display a legend, and don't support other legend options.

## Legend options
<a name="v12-panels-legend-options"></a>

You can find the following options under the **Legend** section in the panel edit pane.

**Note**  
Not all of the options listed apply to all visualizations with legends.

**Visibility**

Set whether the legend is displayed or not. Use the switch to toggle a legend on or off.

**Mode**

Set the format in which the legend is displayed. Choose from:
+ **List**
+ **Table**

When you format a legend as a table, other information about the legend, such as associated values or where it's located in the visualization, might be displayed as well.

**Placement**

Set where on the visualization a legend is displayed. Choose from:
+ **Bottom**
+ **Right**

**Width**

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 vale in the field.

**Values**

You can add more context to a visualization by adding series data values or [calculations](v12-panels-calculation-types.md) to a legend. You can add as many values as you like. After you apply your changes, you can scroll the legend to see all values.

## Changing a series color
<a name="v12-panels-legend-change-color"></a>

By default, Grafana sets the color of your series data, but you can change them through the panel legend.

**To change a series color**

1. Navigate to the panel you want to update.

1. In the legend, select 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.

## Isolating series data in a visualization
<a name="v12-panels-legend-isolate"></a>

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** tab.

**To isolate series data in a visualization**

1. Navigate to the panel you want to update.

1. In the legend, select the label of the series you want to isolate.

   The system removes from view all other series data.

1. To incrementally add series data back to an isolated series, press the **Ctrl** or **Command** key and select 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.

## Sorting series
<a name="v12-panels-legend-sort"></a>

When you format a legend as a table and add values to it, you can sort the series in the table by those values.

**To sort series**

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 of the panel.

1. From the menu, choose **Edit**.

1. Scroll to the **Legend** section of the panel edit pane.

1. Under **Values**, select the value or calculation that you want to show.

   The legend now displays values.

1. Choose the calculation name header in the legend table to sort the values in the table in ascending or descending order.

**Note**  
This feature is only supported in these panels: bar chart, histogram, time series.

# Configure data links
<a name="v12-panels-configure-data-links"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Data links allow you to provide more granular context to your links. You can create links that include the series name or even the value under the cursor. For example, if your visualization shows four servers, you can add a datalink to one or two of them. You can also link panels using data links.

The link itself is accessible in different ways depending on the visualization. For the time series visualization, for example, you choose a data point or line. For large area visualizations, like stat, gauge, or bar gauge, you can choose anywhere on the visualization to open the context menu.

If there is only one data link in the visualization, choosing anywhere on the visualization opens the link rather than the context menu.

**Supported visualizations**
+ Bar chart
+ Bar gauge
+ Candlestick
+ Canvas
+ Gauge
+ Geomap
+ Heatmap
+ Histogram
+ Pie chart
+ Stat
+ State timeline
+ Status history
+ Table
+ Time series
+ Trend

## Data link variables
<a name="v12-panels-data-link-variables"></a>

Variables in data links let you send people to a detailed dashboard with preserved data filters. For example, you could use variable to specify a label, time range, series, or variable selection.

To see a list of available variables, type `$` in the data link **URL** field.

You can also use template variables in your data links URLs, see [Variables](v12-dash-variables.md).

### Time range panel variables
<a name="v12-panels-time-range-panel-variables"></a>

These variables allow you to include the current time range in the data link URL.
+ `__url_time_range` – current dashboard’s time range (i.e. `?from=now-6h&to=now`)
+ `$__from` – For more information, see [Global variables](v12-dash-variable-add.md#v12-dash-variable-add-global).
+ `$__to` – For more information, see [Global variables](v12-dash-variable-add.md#v12-dash-variable-add-global).

### Series variables
<a name="v12-panels-series-variables"></a>

Series specific variables are available under `__series` namespace:
+ `__series.name` – series name to the URL

### Field variables
<a name="v12-panels-field-variables"></a>

Field-specific variables are available under `__field` namespace:
+ `__field.name` – the name of the field
+ `__field.labels.<LABEL>` – label’s value to the URL. If your label contains dots, then use `__field.labels["<LABEL>"]` syntax.

### Value variables
<a name="v12-panels-value-variables"></a>

Value-specific variables are available under `__value` namespace:
+ `__value.time` – value’s timestamp (Unix ms epoch) to the URL (i.e. `?time=1560268814105`)
+ `__value.raw` – raw value
+ `__value.numeric` – numeric representation of a value
+ `__value.text` – text representation of a value
+ `__value.calc` – calculation name if the value is result of calculation

Using value-specific variable in data links can show different result depending on the set option of Tooltip mode.

### Data variables
<a name="v12-panels-data-variables"></a>

To access values from other fields use:
+ `__data.fields[i]` – Value of field `i` (on the same row).
+ `__data.fields["NameOfField"]` – Value of field using name instead of index.
+ `__data.fields[i].labels.cluster` – Access the labels of another field.

### Template variables
<a name="v12-panels-template-variables"></a>

When linking to another dashboard that uses template variables, select variable values for whoever clicks the link.

`${var-myvar:queryparam}` – where `var-myvar` is the name of the template variable that matches one in the current dashboard that you want to use.


| Variable state | Result in the created URL | 
| --- | --- | 
| selected one value | var-myvar=value1 | 
| selected multiple values | var-myvar=value1&var-myvar=value2 | 
| selected All | var-myvar=All | 

If you want to add all of the current dashboard’s variables to the URL, then use `${__all_variables}`.

## Adding a data link
<a name="v12-panels-add-a-datalink"></a>

You can add data links to your panels.

1. Navigate to the panel to which you want to add the data link.

1. Hover over the panel to display the menu icon in the upper-right corner.

1. From the menu, choose **Edit** to open the panel editor.

1. In the **Panel edit** pane, scroll down to the **Data links** section and expand it.

1. Choose **Add link**.

1. In the dialog box that opens, enter a **Title**. This is a human-readable label for the link, which will be displayed in the UI.

1. Enter the **URL** or variable you want to link to.

   To add a data link variable, select the **URL** field and then enter `$` or press Ctrl\$1Space or Cmd\$1Space to see a list of available variables.

1. If you want the link to open in a new tab, then select **Open in a new tab**.

1. Choose **Save** to save changes and close the dialog box.

1. Save your changes to the dashboard.

# Configure value mappings
<a name="v12-panels-configure-value-mappings"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

In addition to field overrides, value mapping is a technique that you can use to change how data appears in a visualization.

Values mappings bypass the unit formatting set in the [Standard options](v12-panels-configure-standard-options.md) of the panel editor, like color or number of decimal places displayed. When value mappings are present in a panel, Grafana displays a summary of them in the **Value mappings** section of the panel editor.

**Supported visualizations**
+ Bar chart
+ Bar gauge
+ Candlestick
+ Canvas
+ Gauge
+ Geomap
+ Histogram
+ Pie chart
+ Stat
+ State timeline
+ Status history
+ Table
+ Time series
+ Trend

## Types of value mappings
<a name="v12-panels-value-mappings-types"></a>

Grafana supports the following value mapping types:
+ **Value** – Maps specific values to a text and a color. For example, you can configure a value mapping so that all instances of the value `10` appear as `Perfection!` rather than the number. Use a **Value** mapping when you want to format a single value.
+ **Range** – Maps numerical ranges to text and a color. For example, if a value is within a certain range, you can configure a range value mapping to display `Low` or `High` rather than the number. Use **Range** mapping when you want to formate multiple continuous values.
+ **Regex** – Maps regular expressions to text and a color. For example, if a value is `www.example.com`, you can configure a regex value mapping so that Grafana displays `www` and truncates the domain. Use the **Regex** mapping when you want to format the text and color of a regular expression value.
+ **Special** – Maps special values like `Null`, `NaN` (not a number), and Boolean values like `true` and `false` to a text and color. For example, you can configure a special value mapping so that `null` values appear as `N/A`. Use the **Special** mappiong when you want to format uncommon, Boolean, or empty value.

## Adding a value mapping
<a name="v12-panels-value-mappings-add"></a>

You can add value mappings to your panels.

**To add a value mapping**

1. Navigate to the panel you want to update.

1. Hover over any part of the panel to display a menu at the top right corner of the panel.

1. From the menu, choose **Edit**.

1. In the **Value mappings** section, choose **Add value mappings**.

1. Choose **Add a new mapping**, and then select one of the following:
   + **Value** – Enter a single value to match.
   + **Range** – Enter the beginning and ending values of a range to match.
   + **Regex** – Enter a regular expression pattern to match.
   + **Special** – Choose a special value to match.

1. (Optional) Enter display text.

1. (Optional) Set the color.

1. Choose **Update** to save the value mapping.

After you've added a mapping, the **Edit value mappings** button replaces the **Add value mappings** button. Choose the edit button to add or update mappings.

# Configure thresholds
<a name="v12-panels-configure-thresholds"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

In dashboards, a threshold is a value or limit you set for a metric that's reflected visually when it's met or exceeded. Thresholds are one way you can conditionally style and color your visualizations based on query results.

You can use thresholds to:
+ Color grid lines or grid ares areas in a time-series visualization.
+ Color the background or value text in a stat visualization.
+ Define regions and region colors in a state timeline.
+ Color lines in a time-series visualization.
+ Color the gauge and threshold markers in a gauge.
+ Color markers in a geomap.
+ Color cell text or background in a table.

**Supported visualizations**
+ Bar chart
+ Bar gauge
+ Candlestick
+ Canvas
+ Gauge
+ Geomap
+ Histogram
+ Stat
+ State timeline
+ Status history
+ Table
+ Time series
+ Trend

## Default thresholds
<a name="v12-panels-thresholds-default"></a>

On visualizations that support thresholds, Grafana has the following default threshold settings:
+ 80 = red
+ Base = green
+ Mode = Absolute
+ Show thresholds = Off (for some visualizations)

  For more information, see [Show thresholds](#v12-panels-thresholds-show).

## Thresholds options
<a name="v12-panels-thresholds-options"></a>

You can set the following options to further define how thresholds look.

### Thresholds value
<a name="v12-panels-thresholds-value"></a>

This number is the value that triggers the threshold. You can also set the color associated with the threshold in this field.

The **Base** value represents minus infinity. By default, it's set to the color green, which is generally the "good" color.

### Thresholds mode
<a name="v12-panels-thresholds-mode"></a>

There are two threshold modes:
+ **Absolute** thresholds are defined by a number. For example, 80 on a scale of 1 to 150.
+ **Percentage** thresholds are defined relative to minimum or maximum. For example, 80 percent.

### Show thresholds
<a name="v12-panels-thresholds-show"></a>

**Note**  
This option is only supported for the bar chart, candlestick, time series, and trend visualizations.

Set if and how thresholds are shown on the visualization with the following options.
+ **Off** – The thresholds are not shown.
+ **As lines** – The thresholds are shown as horizontal lines on the visualization.
+ **As lines (dashed)** – The thresholds are shown as dashed horizontal lines.
+ **As filled regions** – The thresholds are shown as horizontal regions.
+ **As filled regions and lines** – The thresholds are shown as horizontal regions separated by lines.
+ **As filled regions and lines (dashed)** – The thresholds are shown as horizontal regions separated by dashed lines.

## Adding a threshold
<a name="v12-panels-thresholds-add"></a>

You can add as many thresholds to a visualization as you want. Grafana automatically sorts thresholds values from highest to lowest.

**To add a threshold**

1. Navigate to the panel you want to update.

1. Hover over any part of the panel to display the menu at the top right corner.

1. From the menu, select **Edit**.

1. Scroll to the **Thresholds** section, or enter `Thresholds` in the search bar at the top of the panel edit pane.

1. Choose **\$1 Add threshold**.

1. Enter a new threshold value, or use the up and down arrows at the right side of the field to increase or decrease the value incrementally.

1. Click the colored circle to the left of the threshold value to open the color picker, where you can update the threshold color.

1. Under **Thresholds mode**, select either **Absolute** or **Percentage**.

1. Under **Show thresholds**, set how the threshold is displayed, or turn it off.

To delete a threshold, navigate to the panel that contains the threshold and choose the trash icon next to the threshold you want to remove.

# Configure field overrides
<a name="v12-panels-configure-overrides"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Overrides allow you to customize visualization settings for specific fields or series. This is accomplished by adding an override rule that targets a particular set of fields and that can each define multiple options.

For example, you set the unit for all fields that include the text `bytes` by adding an override using the **Fields with name matching regex** matcher and then add the Unit option to the override rule.

## Example 1: Format temperature
<a name="v12-panels-overrides-format-temperature"></a>

Let’s assume that our result set is a data frame that consists of two fields: `time` and `temperature`.


| time | temperature | 
| --- | --- | 
| 2020-01-02 03:04:00 | 45.0 | 
| 2020-01-02 03:05:00 | 47.0 | 
| 2020-01-02 03:06:00 | 48.0 | 

Each field (column) of this structure can have field options applied that alter the way its values are displayed. This means that you can, for example, set the Unit to Temperature > Celsius, resulting in the following table:


| time | temperature | 
| --- | --- | 
| 2020-01-02 03:04:00 | 45.0 °C | 
| 2020-01-02 03:05:00 | 47.0 °C | 
| 2020-01-02 03:06:00 | 48.0 °C | 

In addition, the decimal place is not required, so we can remove it. You can change the Decimals from **auto** to zero (**0**), resulting in the following table:


| time | temperature | 
| --- | --- | 
| 2020-01-02 03:04:00 | 45 °C | 
| 2020-01-02 03:05:00 | 47 °C | 
| 2020-01-02 03:06:00 | 48 °C | 

## Example 2: Format temperature and humidity
<a name="v12-panels-overrides-format-humidity"></a>

Let’s assume that our result set is a data frame that consists of four fields: `time`, `high temp`, `low temp`, and `humidity`.


| time | high temp | low temp | humidity | 
| --- | --- | --- | --- | 
| 2020-01-02 03:04:00 | 45.0 | 30.0 | 67 | 
| 2020-01-02 03:05:00 | 47.0 | 34.0 | 68 | 
| 2020-01-02 03:06:00 | 48.0 | 31.0 | 68 | 

Let’s add the Celsius unit and get rid of the decimal place. This results in the following table:


| time | high temp | low temp | humidity | 
| --- | --- | --- | --- | 
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67 °C | 
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68 °C | 
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68 °C | 

The temperature fields look good, but the humidity must now be changed. We can fix this by applying a field option override to the humidity field and change the unit to Misc > percent (0-100).


| time | high temp | low temp | humidity | 
| --- | --- | --- | --- | 
| 2020-01-02 03:04:00 | 45 °C | 30 °C | 67% | 
| 2020-01-02 03:05:00 | 47 °C | 34 °C | 68% | 
| 2020-01-02 03:06:00 | 48 °C | 31 °C | 68% | 

## Adding a field override
<a name="v12-panels-overrides-add-a-field"></a>

A field override rule can customize the visualization settings for a specific field or series.

**To add a field override**

1. Edit the panel to which you want to add an override.

1. In the panel options side pane, choose **Add field override** at the bottom of the pane.

1. Select which fields an override rule will be applied to:
   + **Fields with name** – Select a field from the list of all available fields. Properties you add to a rule with this selector are only applied to this single field.
   + **Fields with name matching regex** – Specify fields to override with a regular expression. Properties you add to a rule with this selector are applied to all fields where the field name match the regex. This selects fields to override, but doesn't rename the fields; to do this, use the [Rename by regex transformation](v12-panels-xform-functions.md).
   + **Fields with type** – Select fields by type, such as string, numeric, and so on. Properties you add to a rule with this selector are applied to all fields that match the selected type.
   + **Fields returned by query** – Select all fields returned by a specific query, such as A, B, or C. Properties you add to a rule with this selector are applied to all fields returned by the selected query.

1. Choose **Add override property**.

1. Select the field option that you want to apply.

1. Enter options by adding values in the fields. To return options to default values, delete the white text in the fields.

1. Continue to add overrides to this field by choosing **Add override property**, or you can choose **Add override** and select a different field to add overrides to.

1. When finished, choose **Save** to save all panel edits to the dashboard.

## Deleting a field override
<a name="v12-panels-overrides-delete-a-field"></a>

Delete a field override when you no longer need it. When you delete an override, the appearance of value defaults to its original format. This change impacts dashboards and dashboard users that rely on an affected panel.

**To delete a field override**

1. Edit the panel that contains the override you want to delete.

1. In panel options side pane, scroll down until you see the overrides.

1. Choose the override you want to delete and then choose the associated trash icon.

## Viewing field overrides
<a name="v12-panels-overrides-view"></a>

You can view field overrides in the panel display options.

1. Edit the panel that contains the overrides you want to view.

1. In panel options side pane, scroll down until you see the overrides.

**Note**  
The override settings that appear on the **All** tab are the same as the settings that appear on the **Overrides** tab.

## Editing a field override
<a name="v12-panels-overrides-edit-a-field"></a>

Edit a field override when you want to make changes to an override setting. The change you make takes effect immediately.

**To edit a field override**

1. Edit the panel that contains the overrides you want to edit.

1. In panel options side pane, scroll down until you see the overrides.

1. Locate the override that you want to change.

1. Perform any of the following:
   + Edit settings on existing overrides or field selection parameters.
   + Delete existing override properties by choosing the **X** next to the property.
   + Add an override properties by choosing **Add override property**.

# Visualizations available in Grafana version 12
<a name="v12-panels-viz"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Grafana offers a variety of visualizations to support different use cases. This section of the documentation highlights the built-in visualizations, their options and typical usage.

A common panel to get started with, and to learn the basics of using panels, is the [Time series](v12-panels-time-series.md) panel.

**Note**  
If you are unsure which visualization to pick, Grafana can provide visualization suggestions based on the panel query. When you select a visualization, Grafana will show a preview with that visualization applied.
+ Graphs & charts
  + [Time series](v12-panels-time-series.md) is the default and main Graph visualization.
  + [State timeline](v12-panels-state-timeline.md) for state changes over time.
  + [Status history](v12-panels-status-history.md) for periodic state over time.
  + [Bar chart](v12-panels-bar-chart.md) shows any categorical data.
  + [Histogram](v12-panels-histogram.md) calculates and shows value distribution in a bar chart.
  + [Heatmap](v12-panels-heatmap.md) visualizes data in two dimensions, used typically for the magnitude of a phenomenon.
  + [Pie chart](v12-panels-piechart.md) is typically used where proportionality is important.
  + [Candlestick](v12-panels-candlestick.md) is typically for financial data where the focus is price/data movement.
  + [Gauge](v12-panels-gauge.md) is the traditional rounded visual showing how far a single metric is from a threshold.
  + [Trend](v12-panels-trend.md) for datasets that have a sequential, numeric x that is not time.
  + [XY Chart](v12-panels-xychart.md) provides a way to visualize arbitrary x and y values in a graph.
+ Stats & numbers
  + [Stat](v12-panels-stat.md) for big stats and optional sparkline.
  + [Bar gauge](v12-panels-bar-gauge.md) is a horizontal or vertical bar gauge.
+ Misc
  + [Table](v12-panels-table.md) is the main and only table visualization.
  + [Logs](v12-panels-logs.md) is the main visualization for logs.
  + [Node graph](v12-panels-node-graph.md) for directed graphs or networks.
  + [Traces](v12-panels-traces.md) is the main visualization for traces.
  + [Flame graph](v12-panels-flamegraph.md) is the main visualization for profiling.
  + [Geomap](v12-panels-geomap.md) helps you visualize geospatial data.
  + [Datagrid](v12-panels-datagrid.md) allows you to create and manipulate data, and acts as a data source for other panels.
+ Widgets
  + [Dashboard list](v12-panels-dashboard-list.md) can list dashboards.
  + [Alert list](v12-panels-alert-list.md) can list alerts.
  + [Text](v12-panels-text.md) can show markdown and html.
  + [News](v12-panels-news.md) can show RSS feeds.

## Get more
<a name="v12-panels-getmore"></a>

You can add more visualization types by installing panel plugins from the [Find plugins with the plugin catalog](grafana-plugins.md#plugin-catalog).

## Examples
<a name="v12-panels-examples"></a>

In the following sections you can find visualizations examples.

## Graphs
<a name="v12-panels-ex-graphs"></a>

For time based line, area, and bar charts, we recommend the default [time series](v12-panels-time-series.md) visualization.

![\[An image showing examples of times series visualizations in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/time_series_example.png)


For categorical data, use a [bar chart](v12-panels-bar-chart.md).

![\[An image showing examples of bar chart visualizations in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/barchart_example.png)


## Big numbers & stats
<a name="v12-panels-ex-numbers"></a>

A [stat](v12-panels-stat.md) visualization shows one large stat value with an optional graph sparkline. You can control the background or value color using thresholds or color scales.

![\[An image showing an example of a stat visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/stat_panel_example.png)


## Gauge
<a name="v12-panels-ex-gauge"></a>

If you want to present a value as it relates to a min and max value, you have two options. First a standard radial [gauge](v12-panels-gauge.md):

![\[An image showing an example of a gauge visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/gauge_example.png)


Secondly, Grafana also has a horizontal or vertical [bar gauge](v12-panels-bar-gauge.md) with three distinct display modes.

![\[An image showing an example of a gauge visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/bar_gauge_example.png)


## Table
<a name="v12-panels-ex-table"></a>

To show data in a table layout, use a [table](v12-panels-table.md) visualization.

![\[An image showing an example of a table visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/table_example.png)


## Pie chart
<a name="v12-panels-ex-piechart"></a>

To display reduced series, or values in a series, from one or more queries, as they relate to each other, use a [pie chart](v12-panels-piechart.md) visualization.

![\[An image showing an example of a pie chart visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/pie_chart_example.png)


## Heatmaps
<a name="v12-panels-ex-heatmaps"></a>

To show value distribution over time, use a [heatmap](v12-panels-heatmap.md) visualization.

![\[An image showing an example of a heatmap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/heatmap_example.jpg)


## State timeline
<a name="v12-panels-ex-state"></a>

A [state timeline](v12-panels-state-timeline.md) shows discrete state changes over time. When used with time series, thresholds are used to turn numerical values into discrete state regions.

![\[An image showing an example of a state timeline visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/state_timeline_example.png)


# Alert list
<a name="v12-panels-alert-list"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Use alert lists to display your alerts. You can configure the list to show current state. For more information about alerts, see [Alerts in Grafana version 12](v12-alerts.md).

Use these settings to refine your visualization.

## Options
<a name="v12-panels-alert-list-options"></a>
+ **Group mode** – Choose between **Default grouping** to show alert instances grouped by their alert rule, and **Custom grouping** to group alert instances by a custom set of labels.
+ **Max Items** – Set the maximum number of alerts to list.
+ **Sort order** – Select how to order the alerts displayed.
  + **Alphabetical (asc)** – Alphabetical order
  + **Alphabetical (desc)** – Reverse alphabetical order
  +  **Importance** – By importance according to the following values, with 1 being the highest:
    + `alerting` or `firing`: 1
    + `no_data`: 2
    + `pending`: 3
    + `ok`: 4
    + `paused` or `inactive`: 5
  + **Time (asc)** – Newest active alert instances first.
  + **Time (desc)** – Oldest active alert instances first.
+  **Alerts from this dashboard** – Show alerts only from the dashboard that the alert list is in.

## Filter
<a name="v12-panels-alert-filter"></a>

These options allow you to limit alerts shown to only those that match the query, folder, or tags that you choose:
+ **Alert name** – Enter an alert name query.
+ **Alert instance label** – Filter alert instances using label querying. For example, `{severity="critical", instance=~"cluster-us-.+"}`.
+ **Folder** – Select a folder. Only alerts from dashboards in the selected folder will be displayed.
+ **Datasource** – Filter alerts from the selected data source.

## State filter
<a name="v12-panels-alert-state-filter"></a>

Choose which alert states to display in this panel.
+ Alerting / Firing
+ Pending
+ No data
+ Normal
+ Error

# Annotations list
<a name="v12-panels-annotations"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The Annotations list shows a list of available annotations you can use to view annotated data. Various options are available to filter the list based on tags and on the current dashboard.

## Annotation query
<a name="v12-panels-annotations-query"></a>

The following options control the source query for the list of annotations.

**Query Filter**

Use the query filter to create a list of annotations from all dashboards in your organization or the current dashboard in which this panel is located. It has the following options:
+ All dashboards - List annotations from all dashboards in the current organization.
+ This dashboard - Limit the list to the annotations on the current dashboard.

**Time Range**

Use the time range option to specify whether the list should be limited to the current time range. It has the following options:
+ None - no time range limit for the annotations query.
+ This dashboard - Limit the list to the time range of the dashboard where the annotation list panel is available.

**Tags**

Use the tags option to filter the annotations by tags. You can add multiple tags in order to refine the list.

**Note**  
Optionally, leave the tag list empty and filter on the fly by selecting tags that are listed as part of the results on the panel itself.

**Limit**

Use the limit option to limit the number of results returned.

## Display
<a name="v12-panels-annotations-display"></a>

These options control additional metadata included in the annotations panel display.

**Show user**

Use this option to show or hide which user created the annotation.

**Show time**

Use this option to show or hide the annotation creation time.

**Show Tags**

Use this option to show or hide the tags associated with an annotation. *NB*: You can use the tags to live-filter the annotation list on the visualization itself.

## Link behavior
<a name="v12-panels-annotations-links"></a>

**Link target**

Use this option to chose how to view the annotated data. It has the following options.
+ Panel - This option will take you directly to a full-screen view of the panel with the corresponding annotation
+ Dashboard - This option will focus the annotation in the context of a complete dashboard

**Time before**

Use this option to set the time range before the annotation. Use duration string values like “1h” = 1 hour, “10m” = 10 minutes, etc.

**Time after**

Use this option to set the time range after the annotation.

# Bar chart
<a name="v12-panels-bar-chart"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Bar charts allow you to graph categorical data.

![\[An image showing examples of bar chart visualizations in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/barchart_example.png)


## Supported data formats
<a name="v12-panels-bar-chart-formats"></a>

Only one data frame is supported and it needs to have at least one string field that will be used as the category for an X or Y axis and one or more numerical fields. The following is an example of data formats:


| Browser | Market share | 
| --- | --- | 
| Chrome | 50 | 
| Internet Explorer | 17.5 | 

If you have more than one numerical field, the panel shows grouped bars.

### Visualizing time series or multiple result sets
<a name="v12-panels-bar-chart-visualization"></a>

If you have multiple time series or tables, you first need to join them using a join, or reduce transform. For example, if you have multiple time series and you want to compare their last and max value, add the **Reduce** transform and specify **Max** and **Last **as options under **Calculations**.

## Bar chart options
<a name="v12-panels-bar-chart-options"></a>

Use these options to refine your visualization.

**Orientation**
+ **Auto ** – Grafana decides the bar orientation based on the panel dimensions.
+ **Horizontal** – Makes the X axis the category axis.
+ **Vertical** – Makes the Y axis the category axis.

**Rotate x-axis tick labels**

 When the graph is vertically oriented, this setting rotates the labels under the bars. This setting is useful when bar chart labels are long and overlap.

**X-axis tick label maximum length**

Sets the maximum length of bar chart labels. Labels longer than the maximum length are truncated with ellipses.

**Bar labels minimum spacing**

Sets the minimum spacing between bar labels.

**Show values**

Controls whether values are shown on top of or to the left of bars.
+ **Auto** – Values are shown if there is space.
+ **Always** – Always show values.
+ **Never** – Never show values.

**Stacking**

Controls bar chart stacking.
+ **Off** – Bars will not be stacked.
+ **Normal** – Bars will be stacked on top of each other.
+ **Percent** – Bars will be stacked on top of each other, and the height of each bar is the percentage of the total height of the stack.

**Group width**

Controls the width of groups.
+ `0 = Minimum width`
+ `1 = Maximum width`

**Bar width**

Controls the width of bars.
+ `0 = Minimum width`
+ `1 = Maximum width`

**Bar radius**

Controls the radius of the bars.
+ `0 = Minimum radius`
+ `0.5 = Maximum radius`

**Highlight full area on hover**

Controls if the entire surrounding area of the bar is highlighted when you hover over the bar.

**Line width**

Controls line width of the bars.

**Fill opacity**

Controls the fill opacity of the bars.

**Gradient mode**

Sets the mode of the gradient fill. Fill gradient is based on the line color. To change the color, use the standard color scheme field option.

Gradient appearance is influenced by the **Fill opacity** setting.
+ **None** – no gradient fill. This is the default setting.
+ **Opacity** – Transparency of the gradient is calculated based on the values on the y-axis. Opacity of the fill is increasing with the values on the Y-axis.
+ **Hue** – Gradient color is generated based on the hue of the line color.

**Tooltip mode**

When you hover your cursor over the visualization, Grafana can display tooltips. Choose how tooltips behave.
+ **Single ** – The hover tooltip shows only a single series, the one that you are hovering over on the visualization.
+ **All** – The hover tooltip shows all series in the visualization. Grafana highlights the series that you are hovering over in bold in the series list in the tooltip.
+ **Hidden** – Do not display the tooltip when you interact with the visualization.

**Note**  
You can use an override to hide individual series from the tooltip.

**Text size**

Enter a value to change the size of the text on your bar chart.

## Legend options
<a name="v12-panels-bar-chart-legend"></a>

**Legend mode**

Use these settings to define how the legend appears in your visualization. For more information, see [Configure a legend](v12-panels-configure-legend.md).
+ **List** – Displays the legend as a list. This is a default display mode of the legend.
+ **Table** – Displays the legend as a table.
+ **Hidden** – Hides the legend.

**Legend placement**

Choose where to place the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Legend values**

Choose series data values or standard calculations to show in the legend. You can have more than one. For more information, see [Configure a legend](v12-panels-configure-legend.md).

## Axis options
<a name="v12-panels-bar-chart-axis"></a>

Use the following field settings to refine how your axes display. Some field options will not affect the visualization until you click outside of the field option box you are editing or press Enter.

**Placement**

Sets the placement of the Y-axis.
+ **Auto** – Grafana automatically assigns Y-axis to the series. When there are two or more series with different units, then Grafana assigns the left axis to the first unit and right to the following units.
+ **Left** – Display all Y-axes on the left side.
+ **Right** – Display all Y-axes on the right side.
+ **Hidden** – Hide all Y-axes.

To selectively hide axes, [adding field overrides](v12-panels-configure-overrides.md) that targets specific fields.

**Label**

Set a Y-axis text label. If you have more than one Y-axis, then you can assign different labels with an override.

**Width**

Set a fixed width of the axis. By default, Grafana dynamically calculates the width of an axis.

By setting the width of the axis, data with different axes types can share the same display proportions. This makes it easier to compare more than one graph’s worth of data because the axes are not shifted or stretched within visual proximity of each other.

**Soft min and soft max**

Set a soft min or soft max option for better control of Y-axis limits. By default, Grafana sets the range for the Y-axis automatically based on the dataset.

Soft min and soft max settings can prevent blips from turning into mountains when the data is mostly flat, and hard min or max derived from standard min and max field options can prevent intermittent spikes from flattening useful detail by clipping the spikes past a defined point.

You can set standard min/max options to define hard limits of the Y-axis. For more information, see [Configure standard options](v12-panels-configure-standard-options.md).

**Display multiple y-axes**

In some cases, you may want to display multiple y-axes. For example, if you have a dataset showing both temperature and humidity over time, you may want to show two y-axes with different units for these two series.

You can do this by [adding field overrides](v12-panels-configure-overrides.md). Follow the steps as many times as required to add as many y-axes as you need.

# Bar gauge
<a name="v12-panels-bar-gauge"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Bar gauges simplify your data by reducing every field to a single value. You choose how Grafana calculates the reduction.

This panel can show one or more bar gauges depending on how many series, rows, or columns your query returns. Bar gauge visualizations also support legends, improving readability when displaying multiple series.

![\[An image showing an example of a bar gauge visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/bar_gauge_example.png)


## Value options
<a name="v12-panels-bar-gauge-value"></a>

Use the following options to refine how your visualization displays the value:

**Show**

Choose how Grafana displays your data.

**Calculate**

Show a calculated value based on all rows.
+ **Calculation** – Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](v12-panels-calculation-types.md).
+ **Fields** – Select the fields display in the panel.

**All values**

Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
+ **Limit** – The maximum number of rows to display. Default is 5,000.
+ **Fields** – Select the fields display in the panel.

## Bar gauge options
<a name="v12-panels-bar-gauge-options"></a>

Adjust how the bar gauge is displayed.

**Orientation**

Choose a stacking direction.
+ **Auto** – Grafana selects what it thinks is the best orientation.
+ **Horizontal** – Bars stretch horizontally, left to right.
+ **Vertical** – Bars stretch vertically, bottom to top.

**Display mode**

Choose a display mode.
+ **Gradient** – Threshold levels define a gradient.
+ **Retro LCD** – The gauge is split into small cells that are lit or unlit.
+ **Basic** – Single color based on the matching threshold.

**Value display**

Choose a value display mode.
+ **Value color** – Value color is determined by value.
+ **Text color** – Value color is the default text color.
+ **Hidden** – Values are hidden.

**Name placement**

Choose a name placement mode.

**Note**  
This option only applies when the orientation of the bar gauge is horizontal. When the bar gauge is in the vertical orientation, names are always placed at the bottom of each bar gauge.
+ **Auto** – Grafana determines the best placement.
+ **Top** – Names are placed on the top of each bar gauge.
+ **Left** – Names are placed to the left of each bar gauge.

**Show unfilled area**

Select this if you want to render the unfilled region of the bars as dark gray. Not applicable to Retro LCD display mode.

**Bar size**

Choose a bar size mode.
+ **Auto** – Grafana determines the best bar gauge size.
+ **Manual** – Manually configure the bar gauge size.

**Min width**

Limit the minimum width of the bar column when the gauge is oriented vertically.

Automatically show x-axis scrollbar when there is a large amount of data.

**Note**  
This option only applies when bar size is set to manual.

**Min height**

Limit the minimum height of the bar row when the gauge is oriented horizontally.

Automatically show y-axis scrollbar when there is a large amount of data.

**Note**  
This option only applies when bar size is set to manual.

**Max height**

Limit the maximum height of the bar row when the gauge is oriented horizontally.

Automatically show y-axis scrollbar when there is a large amount of data.

**Note**  
This option only applies when bar size is set to manual.

# Candlestick
<a name="v12-panels-candlestick"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The Candlestick visualization allows you to visualize data that includes a number of consistent dimensions focused on price movement. The Candlestick panel includes an Open-High-Low-Close (OHLC) mode, as well as support for additional dimensions based on time series data.

![\[An image showing an example of a candlestick visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/candlestick-panel-example.png)


Candlestick visualizations build upon the foundation of the [Time series](v12-panels-time-series.md) and includes many common configuration settings.

## Mode
<a name="v12-panels-candlestick-mode"></a>

The mode options allow you to toggle which dimensions are used for the visualization.
+ **Candles** – Limit the panel dimensions to the open, high, low, and close dimensions used by candlestick visualizations.
+ **Volume** – Limit the panel dimension to the volume dimension.
+ **Both** – The default behavior for the candlestick panel. It includes both candlestick and volume visualizations.

## Candle style
<a name="v12-panels-candlestick-style"></a>
+ **Candles** – The default display style, creates candle-style visualizations between the open and close dimensions.
+ **OHLC Bars** – Display the four core dimensions open, high, low, and close values.

## Color strategy
<a name="v12-panels-candlestick-color"></a>
+ **Since Open** – The default behavior. This mode will utilize the *Up* color (below) if the intra-period price movement is positive. In other words, if the value on close is greater or equal to the value on open, the *Up* color is used.
+ **Since Prior Close** – An alternative display method where the color of the candle is based on the inter-period price movement or change in value. In other words, if the value on open is greater than the previous value on close, the *Up* color is used. If the value on open is lower than the previous value on close, the *Down* color is used. *This option also triggers the hollow candlestick visualization mode*. Hollow candlesticks indicate that the intra-period movement is positive (value is higher on close than on open), filled candlesticks indicate the intra-period change is negative (value is lower on close than on open). To learn more, see the [explanation of the differences](https://thetradingbible.com/how-to-read-hollow-candlesticks).

## Up & down colors
<a name="v12-panels-candlestick-updown"></a>

The **Up color** and **Down color** options select which colors are used when the price movement is up or down. The *Color strategy* above will determine if intra-period or inter-period price movement is used to select the candle or OHLC bar color.

## Open, high, low, close
<a name="v12-panels-candlestick-ohlc"></a>

The candlestick panel will attempt to map fields to the appropriate dimension.
+ **Open** corresponds to the starting value of the given period.
+ **High** corresponds to the highest value of the given period.
+ **Low** corresponds to the lowest value of the given period.
+ **Close** corresponds to the final (end) value of the given period.
+ **Volume** corresponds to the sample count in the given period. (e.g. number of trades)

**Note**  
The candlestick legend doesn't display these values.

To properly map these dimensions, the query results table from your data must include *at least* the following columns.
+ `timestamp`
+ `open`
+ `high`
+ `low`
+ `close`

If your data can't be mapped to these dimensions for some reason (for example, because the column names aren't the same), you can map them manually using the **Open**, **High**, **Low**, and **Close** fields under the **Candlestick** options in the panel editor.

## Additional fields
<a name="v12-panels-candlestick-other"></a>

**Additional fields**

The candlestick panel is based on the time series visualization. It can visualize additional data dimensions beyond open, high, low, close, and volume. The **Include** and **Ignore** options allow it to visualize other included data such as simple moving averages, Bollinger bands and more, using the same styles and configurations available in the [Time series](v12-panels-time-series.md).

# Canvas
<a name="v12-panels-canvas"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Canvases combine the power of Grafana with the flexibility of custom elements. Canvases are extensible form-built panels that allow you to explicitly place elements within static and dynamic layouts. This empowers you to design custom visualizations and overlay data in ways that aren’t possible with standard Grafana panels, all within Grafana’s UI. If you’ve used popular UI and web design tools, then designing Canvas panels will feel very familiar.

Canvas panels support one-click data links and actions, dynamic connection directions, the ability to disable tooltips, and pan and zoom controls.

## Elements
<a name="v12-panels-canvas-elements"></a>

You can add these elements on your canvas. Adding multiple, and different kinds, of elements lets you customize a visualization in ways that are not possible with any other visualization.

**Metric value**

The metric value element lets you easily select the data you want to display on canvas. This element has a unique *edit* mode that can be triggered either through the context menu **Edit** option or by double-clicking panel. When in edit mode you can select which field data that you want to display.

**Text**

The text element lets you easily add text to the canvas. The element also supports an editing mode, triggered via either double-clicking or the edit menu option in the context menu.

**Ellipse**

The ellipse element lets you add a basic ellipse to the canvas. An ellipse element can display text (both fixed and field data) and its background color can be changed based on data thresholds.

**Rectangle**

The rectangle element lets you to add a basic rectangle to the canvas. A rectangle elements can display text (both fixed and field data) and its background color can be changed based on data thresholds.

**Icon**

The icon element lets you add a supported icon to the canvas. Icons can have their color set based on thresholds or value mappings.

**Server**

The server element lets you easily represent a single server, a stack of servers, a database, or a terminal. Server elements support status color, bulb color, and a bulb blink rate, all configurable by fixed or field values.

**Button**

The button element lets you add a basic button to the canvas. Button elements support triggering basic, unauthenticated API calls. API settings are found in the button element editor. You can also pass template variables in the API editor.

**Note**  
Choosing a button will only trigger an API call when inline editing is disabled. See [Canvas editing](#v12-panels-canvas-editing).

## Connections
<a name="v12-panels-canvas-connections"></a>

When building a canvas, you can connect elements together to create more complex visualizations. You can create connections by dragging from the connection anchor of one element to the connection anchor of another element. You can also create connections to the background of the canvas. Connection anchors are displayed when you hover over an element and inline editing is turned on. To remove a connection, select the connection and then press `Delete` or `Backspace`.

You can set both the size and color of connections based on fixed or field values. To do so, enter into panel edit mode, select the connection, and modify the connection’s properties in the panel editor.

## Canvas editing
<a name="v12-panels-canvas-editing"></a>

**Inline editor**

You can edit your canvas inline while in the context of dashboard mode.

**Pan and zoom**

You and turn on panning and zooming in a canvas. This allows you to both create and navigate more complex designs.

**Note**  
Pan and zoom is currently in preview by Grafana Labs. Support is limited, and breaking changes might occur before general availability.

**Context menu**

The context menu lets you perform common tasks quickly and efficiently. Supported functionality includes opening and closing the inline editor, duplicating an element, deleting an element, and more.

The context menu is triggered by a right click action (or equivalent) over the panel or a given canvas element.

When right clicking *the panel*, you are able to set a background image and easily add elements to the canvas.

When right clicking *an element*, you are able to edit, delete, and duplicate the element, or modify the element’s layer positioning.

## Canvas Options
<a name="v12-panels-canvas-options"></a>

**Inline editing**

The inline editing toggle lets you lock or unlock the canvas panel. When turned off, the canvas panel becomes *locked*, freezing elements in place and preventing unintended modifications.

**Data links**

Canvases support [data links](v12-panels-configure-data-links.md). You can create a data link for a metric-value element and display it for all elements that use the field name by following these steps.

**To create a data link for an element**

1. Set an element to be tied to a field value.

1. Turn off the inline editing toggle.

1. Create an override for **Fields with name** and select the element field name from the list.

1. Choose the **\$1 Add override property** button.

1. Select **Datalinks > Datalinks** from the list.

1. Choose **\$1 Add link**, add a title and URL for the data link.

1. Hover over the element to display the data link tooltip.

1. Choose the element to be able to open the data link.

If multiple elements use the same field name, and you want to control which elements display the data link, you can create a unique field name using the [Add field from calculation](v12-panels-xform-functions.md#v12-panels-xform-funcs-add) transform. The alias you create in the transform will appear as a field you can use with an element.

# Dashboard list
<a name="v12-panels-dashboard-list"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Dashboard lists allow you to display dynamic links to other dashboards. The list can be configured to use starred dashboards, recently viewed dashboards, a search query, and dashboard tags.

On each dashboard load, this panel queries the dashboard list, always providing the most up-to-date results.

**Options**

Use these options to refine your visualization.
+ **Include current time range** – Select this option to propagate the time range of the current dashboard to the dashboard links. When the user selects a link, the linked dashboard opens with the indicated time range already set.
+ **Include current template variable values** – Select this option to include template variables currently used as query parameters in a link. When the user selects a link, any matching templates in the linked dashboard are set to the values from the list. For more information, see [Dashboard URL variables](v12-dash-dashboard-url-variables.md).
+ **Starred** – Display starred dashboards in alphabetical order.
+ **Recently viewed** – Display recently viewed dashboards in alphabetical order.
+ **Search** – Display dashboards by search query or tags. You must enter at least one value in **Query** or **Tags**. For the **Query** and **Tags** fields, variable interpolation is supported, for example, `$my_var` or `${my_var}`.
+ **Show headings** – The chosen list selection (Starred, Recently viewed, Search) is shown as a heading.
+ **Max items** – Sets the maximum number of items to list per section. For example, if you left this at the default value of 10 and displayed Starred and Recently viewed dashboards, then the panel would display up to 20 total dashboards, ten in each section.

**Search**

These options only apply if the **Search** option is selected.
+ **Query** – Enter the query you want to search by. Queries are case-insensitive, and partial values are accepted.
+ **Folder** – Select the dashboard folders that you want to display.
+ **Tags** – Here is where you enter the tags you want to search by. Existing tags will not appear as you type, and they *are* case sensitive.

**Note**  
When multiple tags and strings appear, the dashboard list displays those matching *all* conditions.

# Datagrid
<a name="v12-panels-datagrid"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

**Note**  
The data grid visualization is currently in preview by Grafana Labs. Support is limited, and breaking changes might occur before general availability.

Datagrids offer you the ability to create, edit, and fine-tune data within Grafana. As such, this panel can act as a data source for other panels inside a dashboard.

![\[An image showing an example of a datagrid visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/datagrid-panel-example.png)


Through it, you can manipulate data queried from any data source, you can start from a blank slate, or you can pull data from a dragged and dropped file. You can then use the panel as a simple tabular visualization, or you can modify the data—and even remove it altogether—to create a blank slate.

Editing the dataset changes the data source to use the built-in **Grafana** data source, replacing the old data source settings and related queries, while also copying the current dataset into the dashboard model.

You can then use the panel as a data source for other panels, by using the built-in **Dashboard** data source to pull the datagrid data. This provides an interactive dashboard experience, where you can modify the data and see the changes reflected in other panels.

For more information about the **Grafana** and **Dashboard** data sources, see [Special data sources](AMG-data-sources.md#AMG-data-sources-special).

## Context menu
<a name="v12-panels-datagrid-context"></a>

To provide a more streamlined experience, the datagrid has a context menu that can be accessed by right-clicking on a cell, column header, or row selector. Depending on the state of your datagrid, the context menu offers different options including the following.
+ Delete or clear all rows and columns.
+ Remove all existing data (rendering your datagrid blank).
+ Trigger search functionality, which allows you to find keywords within the dataset.

Deleting a row or column will remove the data from the datagrid, while clearing a row or column will only remove the data from the cells, leaving the row or column intact.

**Header menu**

You can also access a header menu by choosing the dropdown icon next to the header title. From here, you can not only delete or clear a column, but also rename it, freeze it, or convert the field type of the column.

## Selecting series
<a name="v12-panels-datagrid-selectseries"></a>

If there are multiple series, you can set the datagrid to display the preferred dataset using the **Select series** dropdown in the panel options.

## Using datagrids
<a name="v12-panels-datagrid-using"></a>

Datagrids offer various ways of interacting with your data. You can edit, move, clear, and remove rows and columns; use the built-in search functionality to find specific data; and convert field types or freeze horizontal scroll on a specific column.

**Adding data**

You can add data to a datagrid by creating a new column or row.

**To add a new column**

1. In an existing panel, choose the **\$1** button in the table header after the last column.

1. Add a name for the new column.

1. Select anywhere outside the field or press `Enter` to save the column.

Now you can add data in each cell.

To add a new row, choose a **\$1** button after the last row. The button is present in each cell after the last row, and choosing it triggers the creation of a new row while also activating the cell that you chose.

**Editing data**

You can move columns and rows as needed.

**To move a column**

1. Press and hold the header of the column that needs to be moved.

1. Drag the column to the desired location.

1. Release the column to finalize the move.

To move a row, select and hold the row selector from the number column situated on the far left side of the grid, and drag it to the desired location. Release the row to finalize the move.

**Selecting multiple cells**

You can select multiple cells by choosing a single cell, and dragging across others. This select can be used to copy the data from the selected cells or to delete them using the `Delete` key.

**Deleting or clearing multiple rows or columns**

To delete or clear multiple rows, you can do the following.

**To delete or clear multiple rows or columns**

1. Hover over the number column (to the left of the first column in the grid) to display row checkbox.

1. Select the checkboxes for the rows you want to work with. To select multiple consecutive rows, press and hold the `Shift` key while clicking the first and last row. To select non-consecutive rows, press and hold the `Ctrl` (or `Cmd`) key while clicking the desired rows.

1. Right-click (or equiavalent) to access the context menu.

1. Select **Delete rows** or **Clear rows**.

The same rules apply to columns by clicking the column headers.

To delete all rows, use the **Select all** checkbox at the top left corner of the datagrid. This select all rows and allows you to delete them using the context menu.

# Flame graph
<a name="v12-panels-flamegraph"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Flame graphs let you visualize profiling data. Using this visualization, the profile can be represented as a flame graph, table, or both.

![\[An image showing an example of a flame graph visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/flamegraph-panel-example.png)


## Flame graph mode
<a name="v12-panels-flamegraph-mode"></a>

A flame graph takes advantage of the hierarchical nature of profiling data. It condenses data into a format that allows you to easily see which code paths are consuming the most system resources, such as CPU time, allocated objects, or space when measuring memory. Each block in the flame graph represents a function call in a stack and its width represents its value.

Grayed-out sections are a set of functions that represent a relatively small value and they are collapsed together into one section for performance reasons.

You can hover over a specific function to view a tooltip that shows you additional data about that function, like the function's value, percentage of total value, and the number of samples with that function.

**Drop-down actions**

You can click a function to show a drop-down menu with additional actions: 
+ **Focus block** – When you choose **Focus block**, the block, or function, is set to 100% of the flame graph’s width and all its child functions are shown with their widths updated relative to the width of the parent function. This makes it easier to drill down into smaller parts ofthe flame graph.
+ **Copy function name** – When you choose **Copy function name**, the full name of the function that the block represents is copied.
+ **Sandwich view** – The sandwich view allows you to show the context of the clicked function. It shows all the function’s callers on the top and all the callees at the bottom. This shows the aggregated context of the function so if the function exists in multiple places in the flame graph, all the contexts are shown and aggregated in the sandwich view.

**Status bar**

 The status bar shows metadata about the flame graph and currently applied modifications, like what part of the graph is in focus or what function is shown in sandwich view. Click the **X** in the status bar pill to remove that modification.

## Toolbar
<a name="v12-panels-flamegraph-toolbar"></a>

**Search**

You can use the search field to find functions with a particular name. All the functions in the flame graph that match the search will remain colored while the rest of the functions are grayed-out.

**Color schema picker**

You can switch between coloring functions by their value or by their package name to visually tie functions from the same package together.

**Text align**

Align text either to the left or to the right to show more important parts of the function name when it does not fit into the block.

**Visualization picker**

You can choose to show only the flame graph, only table, or both at the same time.

## Top table mode
<a name="v12-panels-flamegraph-toptablemode"></a>

The top table shows the functions from the profile in table format. The table has three columns: symbols, self, and total. The table is sorted by self time by default, but can be reordered by total time or symbol name by clicking the column headers. Each row represents aggregated values for the given function if the function appears in multiple places in the profile.

There are also action buttons on the left for each row. The first button searches for the function name while second button shows the sandwich view of the function.

## Data API
<a name="v12-panels-flamegraph-dataapi"></a>

In order to render the flame graph, you must format the data frame data using a [nested set model](https://wikipedia.org/wiki/Nested_set_model).

A nested set model ensures each item of the flame graph is encoded just by its nesting level as an integer value, its metadata, and by its order in the data frame. This means that the order of items is significant and needs to be correct. The ordering is a depth-first traversal of the items in the flame graph which recreates the graph without needing variable-length values in the data frame like in a children’s array.

Required fields:


| Field name | Type | Description | 
| --- | --- | --- | 
| level | number | The nesting level of the item. In other words how many items are between this item and the top item of the flame graph. | 
| value | number | The absolute or cumulative value of the item. This translates to the width of the item in the graph. | 
| label | string | Label to be shown for the particular item. | 
| self | number | Self value which is usually the cumulative value of the item minus the sum of cumulative values of its immediate children. | 

# Gauge
<a name="v12-panels-gauge"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Gauges are single-value visualizations that can repeat a gauge for every series, column or row.

![\[An image showing an example of a gauge visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/gauge_example.png)


## Value options
<a name="v12-panels-gauge-value"></a>

Use the following options to refine how your visualization displays the value:

**Show**

Choose how Grafana displays your data.

*Calculate*

Show a calculated value based on all rows.
+ **Calculation** – Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](v12-panels-calculation-types.md).
+ **Fields** – Select the fields to display in the panel.

*All values*

Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
+ **Limit** – The maximum number of rows to display. Default is 5,000.
+ **Fields** – Select the fields to display in the panel.

## Gauge
<a name="v12-panels-gauge-gauge"></a>

Adjust how the gauge is displayed.

**Orientation**

Choose a stacking direction.
+ **Auto** – Gauges display in rows and columns.
+ **Horizontal** – Gauges display top to bottom.
+ **Vertical** – Gauges display left to right.

**Show threshold labels**

Controls if threshold values are shown.

**Show threshold markers**

Controls if a threshold band is shown outside the inner gauge value band.

**Gauge size**

Choose a guage size mode
+ **Auto** – Grafana determines the best gauge size.
+ **Manual** – Manually configure the gauge size.

**Min width**

Set the minimum width of vertically-oriented gauges.

If you set a minimum width, the x-axis scrollbar is automatically displayed when there is a large amount of data.

**Note**  
This option only applies when gauge size is set to manual.

**Min height**

Se the minimum height of horizontally-oriented gauges.

If you set a minimum height, the y-axis scrollbar is automatically displayed when there is a large amount of data.

**Note**  
This option only applies when gauge size is set to manual.

**Neutral**

Set the starting value from which every gauge will be filled.

## Text size
<a name="v12-panels-gauge-textsize"></a>

Adjust the sizes of the gauge text.
+ **Title** – Enter a numeric value for the gauge title size.
+ **Value** – Enter a numeric value for the gauge value size.

# Geomap
<a name="v12-panels-geomap"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Geomaps allow you to view and customize the world map using geospatial data. You can configure various overlay styles and map view settings to easily focus on the important location-based characteristics of the data. Geomap visualizations support keyboard navigation for improved accessibility.

**Note**  
You can add your own geospatial data on top of basemap layers provides by AWS. The basemap layers must all come from [https://tiles.maps.search-services.aws.a2z.com](https://tiles.maps.search-services.aws.a2z.com). 

![\[An image showing an example of a geomap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/geomap-panel-example.png)


## Map View
<a name="v12-panels-geomap-view"></a>

The map view controls the initial view of the map when the dashboard loads.

**Initial View**

The initial view configures how the GeoMap panel renders when the panel is first loaded.
+ **View** sets the center for the map when the panel first loads.
  + **Fit to data** fits the map view based on the data extents of Map layers and updates when data changes.
    + **Data** option allows selection of extent based on data from *All layers*, a single *Layer*, or the *Last value* from a selected layer.
    + **Layer** can be selected if fitting data from a single *Layer* or the *Last value* of a layer.
    + **Padding** sets padding in relative percent beyond data extent (not available when looking at *Last value* only).
    + **Max Zoom** sets the maximum zoom level when fitting data.
  + **Coordinates** sets the map view based on:
    + **Latitude**
    + **Longitude**
  + Default views are also available including:
    + **(0°, 0°)**
    + **North America**
    + **South America**
    + **Europe**
    + **Africa**
    + **West Asia**
    + **South Asia**
    + **South-East Asia**
    + **East Asia**
    + **Australia**
    + **Oceania**
+ **Zoom** sets the initial zoom level.

## Map layers
<a name="v12-panels-geomap-layers"></a>

Geomaps support showing multiple layers. Each layer determines how you visualize geospatial data on top of the base map.

**Types**

There are three map layer types to choose from in the Geomap visualization.
+ [Markers layer](#v12-panels-geomap-markers) renders a marker at each data point.
+ [Heatmap layer](#v12-panels-geomap-heatmap) visualizes a heatmap of the data.
+ [GeoJSON layer](#v12-panels-geomap-geojson) renders static data from a GeoJSON file.
+ [Night / Day layer (Alpha)](#v12-panels-geomap-nightday) renders a night or day region.
+ [Route layer (preview)](#v12-panels-geomap-route) render data points as a route.
+ [Photos layer (preview)](#v12-panels-geomap-photos) renders a photo at each data point.
+ [Network layer (preview)](#v12-panels-geomap-network) visualizes a network graph from the data.

There are also two experimental (or alpha) layer types.
+ **Icon at last point (alpha)** renders an icon at the last data point.
+ **Dynamic GeoJSON (alpha)** styles a GeoJSON file based on query results.

**Note**  
Layers marked *preview* or *alpha* in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

**Layer Controls**

The layer controls allow you to create layers, change their name, reorder and delete layers.
+ **Add layer** creates an additional, configurable data layer for the geomap. When you add a layer, you are prompted to select a layer type. You can change the layer type at any point during panel configuration.
+ The layer controls allow you to rename, delete, and reorder the layers of the panel.
  + **Edit layer name** (pencil icon) renames the layer.
  + **Trash Bin** deletes the layer.
  + **Reorder** (six dots/grab handle) allows you to change the layer order. Data on higher layers will appear above data on lower layers. The visualization will update the layer order as you drag and drop to help simplify choosing a layer order.

You can add multiple layers of data to a single geomap panel in order to create rich, detailed visualizations.

**Location**

Geomaps needs a source of geographical data. This data comes from a database query, and there are four mapping options for your data.
+ **Auto** automatically searches for location data. Use this option when your query is based on one of the following names for data fields.
  + *geohash*: `geohash`
  + *latitude*: `latitude`, `lat`
  + *longitude*: `longitude`, `lng`, `lon`
  + *lookup*: `lookup`
+ **Coords** specifies that your query holds coordinate data. You will getprompted to select numeric data fields for latitude and longitude from your database query.
+ **Geohash** specifies that your query holds geohash data. You will be prompted to select a string data field for the geohash from your database query.
+ **Lookup** specifies that your query holds location name data that needs to be mapped to a value. You will be prompted to select the lookup field from your database query and a gazetteer. The gazetteer is the directory that is used to map your queried data to a geographical point.

## Markers layer
<a name="v12-panels-geomap-markers"></a>

The markers layer allows you to display data points as different marker shapes such as circles, squares, triangles, stars, and more.

Markers have many customization options.
+ **Size** configures the size of the markers. The default is `Fixed size`, which makes all marker sizes the same regardless of the data; however, there is also an option to size the markers based on the data corresponding to selected field. `Min` and `Max` marker size has to be set such that the Marker layer can scale within this range.
+ **Symbol** allows you to choose the symbol, icon, or graphic to aid in providing additional visual context to your data. Choose from assets that are included with Grafana such as simple symbols or the Unicon library. You can also specify a URL containing an image asset. The image must be a scalable vector graphic (SVG).
+ **Symbol Vertical Align** configures the vertical alignment of the symbol relative to the data point. Note that the symbol's rotation angle is applies first around the data point, then the vertical alignment is applied relative to the rotation of the symbol.
+ **Symbol Horizontal Align** configures the horizontal alignment of the symbol relative to the data point. Note that the symbol's rotation angle is applies first around the data point, then the horizontal alignment is applied relative to the rotation of the symbol.
+ **Color** configures the color of the markers. The default `Fixed color` sets all markers to a specific color. There is also an option to have conditional colors depending on the selected field data point values and the color scheme set at the **Standard options** section.
+ **Fill opacity** configures the transparency of each marker.
+ **Rotation angle** configures the rotation angle of each marker. The default is **Fixed value**, which makes all markers rotate to the same angle regardless of the data; however, there is also an option to set the rotation of the markers based on data corresponding to a selected field.
+ **Text label** configures a text label for each marker.
+ **Show legend** lets you toggle the legend for the layers.
+ **Display tooltip** lets you toggle tooltips for the layer.

## Heatmap layer
<a name="v12-panels-geomap-heatmap"></a>

The heatmap layer clusters various data points to visualize locations with different densities.

![\[An image showing an example of heatmap using the geomap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/geomap-heatmap-example.png)


To add a heatmap layer:

Choose on the dropdown menu under Data Layer and select `Heatmap`.

Similar to `Markers`, you are prompted with options to determine which data points to visualize and how you want to visualize them.
+ **Weight values** configure the intensity of the heatmap clusters. **Fixed value** keeps a constant weight value throughout all data points. This value should be in the range of 0-1. Similar to Markers, there is an alternate option in the dropdown to automatically scale the weight values depending on data values.
+ **Radius** configures the size of the heatmap clusters.
+ **Blur** configures the amount of blur on each cluster.
+ **Opacity** configures the opacity of each cluster.
+ **Display tooltip** lets you toggle tooltips for the layer.

## GeoJSON layer
<a name="v12-panels-geomap-geojson"></a>

The GeoJSON layer allows you to select and load a static GeoJSON file from the filesystem.
+ **GeoJSON URL** provides a choice of GeoJSON files that ship with Grafana.
+ **Default Style** controls which styles to apply when no rules above match.
  + **Color** configures the color of the default style
  + **Opacity** configures the default opacity
+ **Style Rules** apply styles based on feature properties
  + **Rule** allows you to select a *feature*, *condition*, and *value* from the GeoJSON file in order to define a rule. The trash bin icon can be used to delete the current rule.
  + **Color** configures the color of the style for the current rule
  + **Opacity** configures the transparency level for the current rule.
+ **Add style rule** creates additional style rules.
+ **Display tooltip** lets you toggle tooltips for the layer.

## Night / Day layer (Alpha)
<a name="v12-panels-geomap-nightday"></a>

The Night / Day layer displays night and day regions based on the current time range.

![\[An image showing an example of a night / day layer using the geomap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/geomap-day-night-example.png)


**Options**
+ **Show** toggles the time source from panel time range.
+ **Night region color** picks the color for the night region.
+ **Display sun** toggles sun icon.
+ **Opacity** from 0 (transparent) to 1 (opaque).
+ **Display tooltip** lets you toggle tooltips for the layer.

**Note**  
For more information, see [Extensions for OpenLayers - DayNight](https://viglino.github.io/ol-ext/examples/layer/map.daynight.html).

## Route layer (preview)
<a name="v12-panels-geomap-route"></a>

The Route layer renders data points as a route.

**Note**  
The Route layer is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

![\[An image showing an example of a route layer using the geomap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/geomap-route-layer-example.png)


**Options**
+ **Size** sets the route thickness. Fixed value by default. When field data is selected, you can set the Min and Max range in which field data can scale.
+ **Color** sets the route color. Set to fixed color by default, you can also tie the color to field data.
+ **Fill opacity** configures the opacity of the route.
+ **Text label** configures a text label for each route.
+ **Arrow** configures the arrow styling to display along the route, in order of data.
  + **None**
  + **Forward**
  + **Reverse**
+ **Display tooltip** lets you toggle tooltips for the layer.

**Note**  
For more information, see [Extensions for OpenLayers - Flow Line Style](http://viglino.github.io/ol-ext/examples/style/map.style.gpxline.html).

## Photos layer (preview)
<a name="v12-panels-geomap-photos"></a>

The Photos layer renders a photo at each data point.

**Note**  
The Photos layer is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

**Options**
+ **Image Source Field** lets you select a string field containing image data as a Base64 encoded image binary (`data:image/png;base64,...`).
+ **Kind** sets the frame style around the images. Choose from:
  + **Square**
  + **Circle**
  + **Anchored**
  + **Folio**
+ **Crop** toggles whether the images are cropped to fit.
+ **Shadow** toggles a box shadow behind the images.
+ **Border** sets the border size around images.
+ **Border color** sets the border color around images.
+ **Radius** sets the overall size of images in pixels.
+ **Display tooltip** lets you toggle tooltips for the layer.

**Note**  
For more information, see [Extensions for OpenLayers - Image Photo Style](http://viglino.github.io/ol-ext/examples/style/map.style.photo.html).

## Network layer (preview)
<a name="v12-panels-geomap-network"></a>

The Network layer renders a network graph. This layers supports the same data format supported by the node graph visualization, with the addition of geospatial data included in the nodes data. The geospatial data is used to locate and render the nodes on the map.

**Note**  
The Network layer is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

![\[An image showing examples of network visualizations within a geomap in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/geomap-network-layer-example.png)


**Note**  
The Network layer is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available.

**Options**
+ **Arrow** sets the arrow direction to display for each edge, with forward meaning source to target. Choose from:
  + **None**
  + **Forward**
  + **Reverse**
  + **Both**
+ **Show legend** lets you toggle the legend for the layer. The legend only supports node data.
+ **Display tooltip** lets you toggle tooltips for the layer.

**Node styles**
+ **Size** configures the size of the nodes. The default is **Fixed size**, which makes all node sizes the same regardless of the data; however, there is also an option to size the nodes based on data corresponding to a selected field. **Min** and **Max** node sizes have to be set such that the nodes can scale within this range.
+ **Color** configures the color of the nodes. The default is **Fixed color**, which sets all nodes to a specific color. There is also an option to have conditional colors depending on the selected field data point values and the color scheme set in the **Standard options** section.
+ **Symbol** lets you choose the symbol, icon, or graphic to aid in providing additional visual context to your data. Choose from assets that are included with Grafana, such as simple symbols or the Unicon library. You can also specify a URL containing an image asset. The image must be a scalable vector graphic (SVG).
+ **Fill opacity** configures the transparency of each node.
+ **Rotation angle** configures the rotation angle of each node. The default is **Fixed value**, which makes all nodes rotate to the same angle regardless of the data; however, there is also an option to set the rotation of the nodes based on data corresponding to a selected field.
+ **Text label** configures a text label for each node.

**Edge styles**
+ **Size** configures the line width of the edges. The default is **Fixed size**, which makes all edge line widths the same regardless of the data; however, there is also an option to size the edges based on data corresponding to a selected field. **Min** and **Max** edge sizes have to be set such that the edges can scale within this range.
+ **Color** configures the color of the edges. The default is **Fixed color**, which sets all edges to a specific color. There is also an option to have conditional colors depending on the selected field data point values and the color scheme set in the **Standard options** section.
+ **Fill opacity** configures the transparency of each edge.
+ **Text label** configures a text label for each edge.

## CARTO layer
<a name="v12-panels-geomap-carto"></a>

CARTO layers are not supported in Amazon Managed Grafana.

## XYZ tile layer
<a name="v12-panels-geomap-xyz"></a>

XYZ tile layers are not supported in Amazon Managed Grafana.

## Open Street Map layer
<a name="v12-panels-geomap-osm"></a>

Open Street Map layers (other than the default basedmap) are not supported in Amazon Managed Grafana.

## ArcGIS layer
<a name="v12-panels-geomap-arcgis"></a>

ArcGIS layers are not supported in Amazon Managed Grafana.

## Map Controls
<a name="v12-panels-geomap-controls"></a>

The map controls section contains various options for map information and tool overlays.

**Zoom**

Options for zoom controls.

*Show zoom control*

Displays zoom controls in the upper left corner.

*Mouse wheel zoom*

Turns on or off using the mouse wheel for zooming in or out.

**Show attribution**

Displays attribution for basemap layers on the map.

**Show scale**

Displays scale information in the bottom left corner.

**Note**  
Displays units in [m]/[km].

**Show measure tools**

Displays measure tools in the upper right corner. Measurements appear only when this control is open.
+ **Click** to start measuring
+ **Continue clicking** to continue measurement
+ **Double-click** to end measurement

**Note**  
When you change measurement type or units, the previous measurement is removed from the map.  
If the control is closed and then re-opened, the most recent measurement is displayed.  
A measurement can be modified by clicking and dragging on it.

*Length*

Get the spherical length of a geometry. This length is the sum of the great circle distances between coordinates. For multi-part geometries, the length is the sum of the length of each part. Geometries are assumed to be in ‘EPSG:3857’.

You can choose the following units for length measurements:
+ **Metric (m/km)**
+ **Feet (ft)**
+ **Miles (mi)**
+ **Nautical miles (nmi)**

*Area*

Get the spherical area of a geometry. This area is calculated assuming that polygon edges are segments of great circles on a sphere. Geometries are assumed to be in ‘EPSG:3857’.

You can choose the following units for area measurements:
+ **Square Meters (m²)**
+ **Square Kilometers (km²)**
+ **Square Feet (ft²)**
+ **Square Miles (mi²)**
+ **Acres (acre)**
+ **Hectare (ha)**

**Show debug**

Displays debug information in the upper right corner of the map. This can be useful for debugging or validating a data source.
+ **Zoom** displays the current zoom level of the map.
+ **Center** displays the current **longitude**, and **latitude** of the map center.

**Tooltip**
+ **None** displays tooltips only when a data point is clicked.
+ **Details** displays tooltips when a pointer hovers over a data point.

# Heatmap
<a name="v12-panels-heatmap"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The Heatmap panel visualization allows you to view histograms over time. For more information about histograms, refer to [Introduction to histograms and heatmaps](getting-started-grafanaui.md#introduction-to-histograms-and-heatmaps).

![\[An image showing an example of a heatmap visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/heatmap_example.jpg)


## Calculate from data
<a name="v12-panels-heatmap-calculate"></a>

This setting determines if the data is already a calculated heatmap (from the data source/transformer), or one that should be calculated in the panel.

**X Bucket**

This setting determines how the X-axis is split into buckets. You can specify a time interval in the **Size** input. For example, a time range of `1h` makes the cells 1-hour wide on the X-axis.

**Y Bucket**

This setting determines how the Y-axis is split into buckets.

**Y Bucket scale**

Select one of the following Y-axis value scales:
+ **linear** – Linear scale.
+ **log (base 2)** – Logarithmic scale with base 2.
+ **log (base 10)** – Logarithmic scale with base 10.
+ **symlog** – Symlog scale.

## Y Axes
<a name="v12-panels-heatmap-y-axes"></a>

Defines how the Y axis is displayed

**Placement**
+ **Left** – On the left
+ **Right** – On the right
+ **Hidden** – Hidden

**Unit**

Unit configuration

**Decimals**

This setting determines decimal configuration.

**Min/Max value**

This setting configures the axis range.

**Reverse**

When selected, the axis appears in reverse order.

**Display multiple y-axes**

In some cases, you may want to display multiple y-axes. For example, if you have a dataset showing both temperature and humidity over time, you may want to show two y-axes with different units for these two series.

You can do this by [adding field overrides](v12-panels-configure-overrides.md). Follow the steps as many times as required to add as many y-axes as you need.

## Colors
<a name="v12-panels-heatmap-colors"></a>

The color spectrum controls the mapping between value count (in each bucket) and the color assigned to each bucket. The leftmost color on the spectrum represents the minimum count and the color on the right most side represents the maximum count. Some color schemes are automatically inverted when using the light theme.

You can also change the color mode to Opacity. In this case, the color will not change but the amount of opacity will change with the bucket count
+ **Mode**
  + **Scheme** – Bucket value represented by cell color.
    + **Scheme** – If the mode is **Scheme**, then select a color scheme.
  + **opacity** – Bucket value represented by cell opacity. Opaque cell means maximum value.
    + **Color** – Cell base color.
    + **Scale** – Scale for mapping bucket values to the opacity.
      + **linear** – Linear scale. Bucket value maps linearly to the opacity.
      + **sqrt** – Power scale. Cell opacity calculated as `value ^ k`, where `k` is a configured **Exponent** value. If exponent is less than `1`, you will get a logarithmic scale. If exponent is greater than `1`, you will get an exponential scale. In case of `1`, scale will be the same as linear.
    + **Exponent** – value of the exponent, greater than `0`.

**Start/end color from value**

By default, Grafana calculates cell colors based on minimum and maximum bucket values. With Min and Max you can overwrite those values. Consider a bucket value as a Z-axis and Min and Max as Z-Min and Z-Max, respectively.
+ **Start** – Minimum value using for cell color calculation. If the bucket value is less than Min, then it is mapped to the “minimum” color. The series min value is the default value.
+ **End** – Maximum value using for cell color calculation. If the bucket value is greater than Max, then it is mapped to the “maximum” color. The series max value is the default value.

## Cell display
<a name="v12-panels-heatmap-cell"></a>

Use these settings to refine your visualization.

## Additional display options
<a name="v12-panels-heatmap-options"></a>

**Tooltip**
+ **Show tooltip** – Show heatmap tooltip.
+ **Show Histogram** – Show a Y-axis histogram on the tooltip. A histogram represents the distribution of the bucket values for a specific timestamp.
+ **Show color scale** – Show a color scale on the tooltip. The color scale represents the mapping between bucket value and color.

**Legend**

Choose whether you want to display the heatmap legend on the visualization.

**Exemplars**

Set the color used to show exemplar data.

# Histogram
<a name="v12-panels-histogram"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The histogram visualization calculates the distribution of values and presents them as a bar chart. The Y-axis and the height of each bar represent the count of values that fall into each bracket while the X-axis represents the value range.

![\[An image showing an example of a histogram visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/histogram-example.png)


## Supported formats
<a name="v12-panels-histogram-formats"></a>

Histogram visualization supports time series and any table results with one or more numerical fields.

## Display options
<a name="v12-panels-histogram-options"></a>

Use these options to refine your visualizations.

**Bucket size**

The size of the buckets. Leave this empty for automatic bucket sizing (\$110% of the full range).

**Bucket offset**

If the first bucket should not start at zero. A non-zero offset shifts the aggregation window. For example, 5-sized buckets that are 0–5, 5–10, 10–15 with a default 0 offset would become 2–7, 7–12, 12–17 with an offset of 2; offsets of 0, 5, or 10, in this case, would effectively do nothing. Typically, this option would be used with an explicitly defined bucket size rather than automatic. For this setting to affect, the offset amount should be greater than 0 and less than the bucket size; values outside this range will have the same effect as values within this range.

**Combine series**

This will merge all series and fields into a combined histogram.

**Line width**

Controls line width of the bars.

**Fill opacity**

Controls the fill opacity of the bars.

**Gradient mode**

Set the mode of the gradient fill. Fill gradient is based on the line color. To change the color, use the standard color scheme field option. Gradient appearance is influenced by the **Fill opacity** setting.
+  **None ** – No gradient fill, this is the default setting.
+  **Opacity** – Transparency of the gradient is calculated based on the values on the Y-axis. Opacity of the fill is increasing with the values on the Y-axis.
+  **Hue** – Gradient color is generated based on the hue of the line color.

## Legend options
<a name="v12-panels-histogram-legend"></a>

When the legend option is enabled, it can show either the value mappings or the threshold brackets. To show the value mappings in the legend, it’s important that the Color scheme option under standard options is set to Single color or Classic palette. To see the threshold brackets in the legend, set the Color scheme to From thresholds. For more information about the legend, see [Configure a legend](v12-panels-configure-legend.md).

**Legend mode**

Use these settings to define how the legend appears in your visualization.
+  **List ** – Displays the legend as a list. This is a default display mode of the legend.
+  **Table** – Displays the legend as a table.
+  **Hidden** – Hides the legend.

**Legend placement**

Choose where to place the legend.
+  **Bottom ** – Below the graph.
+  **Right** – To the right of the graph.

**Legend Values**

Choose which of the standard calculations to show in the legend. You can have more than one. For more information, see [Calculation types](v12-panels-calculation-types.md).

**Legend calculations**

Choose which calculations to show in the legend. You can select more than one.

# Logs
<a name="v12-panels-logs"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The logs panel visualization shows log lines from data sources that support logs, such as Elastic, Influx, and Loki. Typically, you would use this panel next to a graph panel to display the log output of a related process.

The logs panel shows the result of queries that were entered on the **Query** tab. The results of multiple queries are merged and sorted by time. You can scroll inside the panel if the data source returns more lines than can be displayed.

To limit the number of lines rendered, you can use the **Max data points** setting in the **Query options**. If it is not set, the data source will usually enforce a default limit.

## Log level
<a name="v12-panels-logs-level"></a>

For logs where a **level** label is specified, we use the value of the label to determine the log level and update color accordingly. If the log doesn’t have a level label specified, we try to find out if its content matches any of the supported expressions (see below for more information). The log level is always determined by the first match. In case Grafana is not able to determine a log level, it will be visualized with **unknown** log level. For more information, see [Log level](v12-explore-logs.md#v12-explore-log-level).

## Log details
<a name="v12-panels-logs-details"></a>

Each log row has an extendable area with its labels and detected fields, for more robust interaction. Each field or label has a stats icon to display statistics in relation to all displayed logs.

**Data links**

By using data links, you can turn any part of a log message into an internal or external link. The created link is visible as a button in the **Links** section inside the **Log details** view.

**Display options**

Use the following settings to refine your visualization:
+ **Time** – Show or hide the time column. This is the timestamp associated with the log line as reported from the data source.
+ **Unique labels** – Show or hide the unique labels column, which shows only non-common labels.
+ **Common labels** – Show or hide the common labels
+ **Wrap lines** – Toggle line wrapping.
+ **Prettify JSON** – Set this to `true` to pretty print all JSON logs. This setting does not affect logs in any format other than JSON.
+ **Enable log details** – Toggle option to see the log details view for each log row. The default setting is `true`.
+ **Order** – Display results in descending or ascending time order. The default is **Descending**, showing the newest logs first. Set to **Ascending** to show the oldest log lines first.

# News
<a name="v12-panels-news"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

The news visualization displays an RSS feed. By default, it displays articles from the Grafana Labs blog, and users can change this by entering a different RSS feed URL.

Enter the URL of an RSS in the **Display** section. This visualization type does not accept any other queries, and users should not expect to be able to ilter or query the RSS feed data in any way using this visualization.

**Note**  
RSS feeds are loaded by the Grafana front end without a proxy. As a result, only RSS feeds that are configured with the appropriate [CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) will load. If the RSS feed you're trying to display fails to load, consider re-hosting the RSS feed or creating your own proxy.

# Node graph
<a name="v12-panels-node-graph"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Node graphs can visualize directed graphs or networks. They use a directed force layout to effectively position the nodes, so they can help with displaying complex infrastructure maps, hierarchies, or run diagrams.

## Data requirements
<a name="v12-panels-node-graph-requirements"></a>

A node graph requires a specific shape of the data to be able to display its nodes and edges. Not every data source or query can be visualized with this graph. If you want to use this as a data source developer, see the section about data API.

A node graph consists of *nodes* and *edges*.
+ A *node* is displayed as a circle. A node might represent an application, a service, or anything else that is relevant from an application perspective.
+ An *edge* is displayed as a line that connects two nodes. The connection might be a request, an operation, or some other relationship between the two nodes.

Both nodes and edges can have associated metadata or statistics. The data source defines what information and values is shown, so different data sources can show different type of values or not show some values.

## Nodes
<a name="v12-panels-node-graph-nodes"></a>

Usually, nodes show two statistical values inside the node and two identifiers just below the node, usually name and type. Nodes can also show another set of values as a color circle around the node, with sections of different color representing different values that should add up to 1. For example, you can have the percentage of errors represented by red portion of the circle.

Additional details can be displayed in a context menu, which is displayed when you choose the node. There also can be additional links in the context menu that can target either other parts of the Grafana workspace or any external link.

**Note**  
Node graph can show only 1,500 nodes. If this limit is crossed, a warning is visible in the upper right corner, and some nodes will be hidden. You can expand hidden parts of the graph by clicking on the **Hidden nodes** markers in the graph.

## Edges
<a name="v12-panels-node-graph-edges"></a>

Edges can also show statistics when you hover over the edge. Similar to nodes, you can open a context menu with additional details and links by choosing the edge.

The first data source supporting this visualization is the AWS X-Ray data source for its service map feature. For more information, see [Connect to an AWS X-Ray data source](x-ray-data-source.md).

## Navigating the node graph
<a name="v12-panels-node-graph-navigation"></a>

**Pan**

You can pan within the node graph by choosing outside of any node or edge and dragging the pointer.

**Zoom in or out**

You can zoom by using the buttons on the upper left corner of the node graph, or use a mouse wheel or other scroll input with the `Ctrl` (or `Cmd`) key.

**Explore hidden nodes**

The number of nodes shown at a given time is limited to maintain a reasonable performance. Nodes that are outside this limit are hidden behind selectable markers that show an approximate number of hidden nodes that are connected to that edge. You can choose the marker to expand the graph around that node.

**Grid view**

You can switch to the grid view to have a better overview of the most interesting nodes in the graph. Grid view shows nodes in a grid without edges and can be sorted by stats shown inside the node or by stats represented by the a colored border of the nodes.

To sort the nodes, choose the stats inside the legend. The marker next to the stat name (either `˄` or `˅`) shows which stat is currently used for sorting and sorting direction.

Choose a node and then select the **Show in Graph layout** option to switch back to graph layout with focus on the selected node, to show it in context of the full graph.

## Data API
<a name="v12-panels-node-graph-data-api"></a>

This visualization needs a specific shape of the data to be returned from the data source in order to correctly display it.

Node Graph at minimum requires a data frame describing the edges of the graph. By default, node graph will compute the nodes and any stats based on this data frame. Optionally a second data frame describing the nodes can be sent in case there is need to show more node specific metadata. You have to set `frame.meta.preferredVisualisationType = 'nodeGraph'` on both data frames or name them `nodes` and `edges` respectively for the node graph to render.

**Edges data from structure**

Required fields:


| Field name | Type | Description | 
| --- | --- | --- | 
| id | string | Unique identifier of the edge. | 
| source | string | Id of the source node. | 
| target | string | Id of the target. | 

Optional fields:


| Field name | Type | Description | 
| --- | --- | --- | 
| mainstat | string/number | First stat shown in the overlay when hovering over the edge. It can be a string showing the value as is or it can be a number. If it is a number, any unit associated with that field is also shown. | 
| secondarystat | string/number | Same as mainStat, but shown right under it. | 
| detail\$1\$1\$1 | string/number | Any field prefixed with `detail__` will be shown in the header of context menu when clicked on the edge. Use `config.displayName` for a more human readable label. | 

**Nodes data from structure**

Required fields:


| Field name | Type | Description | 
| --- | --- | --- | 
| id | string | Unique identifier of the node. This ID is referenced by edge in its source and target field. | 

Optional fields:


| Field name | Type | Description | 
| --- | --- | --- | 
| title | string | Name of the node visible just under the node. | 
| subtitle | string | Additional, name, type or other identifier shown under the title. | 
| mainstat | string/number | First stat shown inside the node itself. It can either be a string showing the value as is or a number. If it is a number, any unit associated with that field is also shown.  | 
| secondarystat | string/number | Same as mainStat, but shown under it inside the node. | 
| arc\$1\$1\$1 | number | Any field prefixed with `arc__` will be used to create the color circle around the node. All values in these fields should add up to 1. You can specify color using `config.color.fixedColor`. | 
| detail\$1\$1\$1 | string/number | Any field prefixed with `detail__` will be shown in the header of context menu when clicked on the node. Use `config.displayName` for more human readable label. | 
| color | string/number | Can be used to specify a single color instead of using the `arc__` fields to specify color sections. It can either be a string (it must be an acceptable HTML color string), or it can be a number, in which case the behavior depends on the `field.config.color.mode` setting. This can be used, for example, to create gradient colors controlled by a field value. | 
| icon | string | Name of the icon to show inside the node instead of the default stats. Only Grafana built in icons are allowed (see the available icons [here](https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview)). | 
| nodeRadius | number | Radius value in pixels. Used to manage node size. | 
| highlighted | Boolean | Sets whether the node should be highlighted. Use, for example, to represent a specific path in the graph by highlighting several nodes and edges. Defaults to `false`. | 

# Pie chart
<a name="v12-panels-piechart"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

![\[An image showing an example of a pie chart visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/pie_chart_example.png)


The pie chart displays reduced series, or values in a series, from one or more queries, as they relate to each other, in the form of slices of a pie. The arc length, area and central angle of a slice are all proportional to the slices value, as it relates to the sum of all values. This type of chart is best used when you want a quick comparison of a small set of values in an aesthetically pleasing form.

## Value options
<a name="v12-panels-piechart-value"></a>

Use the following options to refine the value in your visualization.

**Show**

Choose how much information to show.
+ **Calculate** – Reduces each value to a single value per series.
+ **All values** – Displays every value from a single series.

**Calculation**

Select a calculation to reduce each series when **Calculate** has been selected. For information about available calculations, refer to [Calculation types](v12-panels-calculation-types.md).

**Limit**

When displaying every value from a single series, this limits the number of values displayed.

**Fields**

Select at least one field to display in the visualization. Each field name is available on the list, or you can select one of the following options:
+ **Numeric fields** – All fields with numerical values.
+ **All fields** – All fields that are not removed by transformations.
+ **Time** – All fields with time values.

## Pie chart options
<a name="v12-panels-piechart-options"></a>

Use these options to refine how your visualization looks.

**Pie chart type**

Select the pie chart display style. Can be either:
+ **Pie** – A standard pie chart
+ **Donut** – A pie chart with a hole in the middle

**Labels**

Select labels to display on the pie chart. You can select more than one.
+ **Name** – The series or field name.
+ **Percent** – The percentage of the whole.
+ **Value** – The raw numerical value.

Labels are displayed in white over the body of the chart by default. You can select darker chart colors to make them more visible. Long names or numbers might be clipped.

**Tooltip mode**

When you hover your cursor over the visualization, Grafana can display tooltips. Choose how tooltips behave.
+ **Single** – The hover tooltip shows only a single series, the one that you are hovering over on the visualization.
+ **All** – The hover tooltip shows all series in the visualization. Grafana highlights the series that you are hovering over in bold in the series list in the tooltip.
+ **Hidden** – Do not display the tooltip when you interact with the visualization.

Use an override to hide individual series from the tooltip.

## Legend options
<a name="v12-panels-piechart-legend"></a>

Use these settings to define how the legend appears in your visualization. For more information about the legend, refer to [Configure a legend](v12-panels-configure-legend.md).

**Legend visibility**

Use the **Visibility** toggle to show or hide the legend.

**Legend mode**

Set the display mode of the legend.
+ **List** – Displays the legend as a list. This is the default display mode of the legend.
+ **Table** – Displays the legend as a table.

**Legend placement**

Choose where to display the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Legend values**

Select values to display in the legend. You can select more than one.
+ **Percent** – The percentage of the whole.
+ **Value** – The raw numerical value.

For more information about the legend, refer to [Configure a legend](v12-panels-configure-legend.md).

# Stat
<a name="v12-panels-stat"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Stats show one large stat value with an optional graph sparkline. You can control the background or value color using thresholds or overrides. Stat panels also display percent change with configurable color mode options, making it easier to see trends at a glance.

![\[An image showing an example of a stat visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/stat_panel_example.png)


By default, a Stat displays one of the following:
+ Just the value for a single series or field.
+ Both the value and name for multiple series or fields.

You can use the **Text mode** to control whether the text is displayed or not.

## Automatic layout adjustment
<a name="v12-panels-stat-automatic-adjust"></a>

The panel automatically adjusts the layout depending on available width and height in the dashboard. It automatically hides the graph (sparkline) if the panel becomes too small.

## Value options
<a name="v12-panels-stat-value"></a>

Use the following options to refine how your visualization displays the value:

**Show**

Choose how Grafana displays your data.
+ **Calculate**

  Show a calculated value based on all rows.
  + **Calculation** – Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, see [standard calculations](v12-panels-calculation-types.md).
  + **Fields** – Select the fields display in the visualization.
+ **All values**

  Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display.
  + **Limit** – The maximum number of rows to display. Default is 5,000.
  + **Fields** – Select the fields display in the visualization.

## Stat styles
<a name="v12-panels-stat-styles"></a>

Style your visualization.

**Orientation**

Choose a stacking direction.
+ **Auto** – Grafana selects what it thinks is the best orientation.
+ **Horizontal** – Bars stretch horizontally, left to right.
+ **Vertical** – Bars stretch vertically, top to bottom.

**Text mode**

You can use the Text mode option to control what text the visualization renders. If the value is not important, only the name and color is, then change the **Text mode** to **Name**. The value will still be used to determine color and is displayed in a tooltip.
+ **Auto** – If the data contains multiple series or fields, show both name and value.
+ **Value** – Show only value, never name. Name is displayed in the hover tooltip instead.
+ **Value and name** – Always show value and name.
+ **Name** – Show name instead of value. Value is displayed in the hover tooltip.
+ **None** – Show nothing (empty). Name and value are displayed in the hover tooltip.

**Wide layout**

Set whether wide layout is enabled or not. Wide layout is enabled by default.
+ **On** – Wide layout is turned on.
+ **Off** – Wide layout is turned off.

**Note**  
This option is only applicable when **Text mode** is set to **Value and name**. When wide layout is turned on, the value and name are displayed side-by-side with the value on the right, if the panel is wide enough. When wide layout is turned off, the value is always rendered underneath the name.

**Color mode**

Select a color mode.
+ **None** – No color is applied to the value.
+ **Value** – Applies colors to the value and graph area.
+ **Background Gradient** – Applies color to the value, graph area, and background, with a slight background gradient.
+ **Background Solid** – Applies color to the value, graph area, and background, with a solid background color.

**Graph mode**

Select a graph and sparkline mode.
+ **None** – Hides the graph and only shows the value.
+ **Area** – Shows the area graph below the value. This requires that your query returns a time column.

**Text alignment**

Choose an alignment mode.
+ **Auto** – If only a single value is shown (no repeat), then the value is centered. If multiple series or rows are shown, then the value is left-aligned.
+ **Center** – Stat value is centered.

**Show percent change**

Set whether percent change is displayed or not. By default it is not shown.

**Note**  
This option is not applicable when the **Show** setting, under **Value options**, is set to **All values**.

## Text size
<a name="v12-panels-stat-textsize"></a>

Adjust the sizes of the gauge text.
+ **Title** – Enter a numeric value for the gauge title size.
+ **Value** – Enter a numeric value for the gauge value size.

# State timeline
<a name="v12-panels-state-timeline"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

State timelines show discrete state changes over time. Each field or series is rendered as its unique horizontal band. State regions can either be rendered with or without values. This panel works well with string or boolean states but can also be used with time series. When used with time series, the thresholds are used to turn the numerical values into discrete state regions. State timeline visualizations support pagination, making it easier to navigate large datasets.

![\[An image showing an example of a state timeline visualizations in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/state_timeline_example.png)


## State timeline options
<a name="v12-panels-state-timeline-options"></a>

Use these options to refine your visualizations:

**Merge equal consecutive values**

Controls whether Grafana merges identical values if they are next to each other.

**Show values**

Controls whether values are rendered inside the state regions. **Auto** will render values if there is sufficient space.

**Align values**

Controls value alignment inside state regions.

**Row height**

Controls space between rows. 1 = no space = 0.5 = 50% space.

**Line width**

Controls the line width of state regions.

**Fill opacity**

Controls the opacity of state regions.

**Connect null values**

Choose how null values, which are gaps in the data, appear on the graph. Null values can be connected to form a continuous line or set to a threshold above which gaps in the data are no longer connected.
+ **Never** – Time series data points with gaps in the data are never connected.
+ **Always** – Time series data points with gaps in the data are always connected.
+ **Threshold** – Specify a threshold above which gaps in the data are no longer connected. This can be useful when the connected gaps in the data are of a known size or within a known range, and gaps outside this range should no longer be connected.

**Disconnect values**

Choose whether to set a threshold above which values in the data should be disconnected.
+ **Never** – Time series data points in the data are never disconnected.
+ **Threshold** – Specify a threshold above which values in the data are disconnected. This can be useful when desired values in the data are of a known size or within a known range, and values outside this range should no longer be connected.

## Value mappings
<a name="v12-panels-state-timeline-valuemap"></a>

To assign colors to boolean or string values, use [Configure value mappings](v12-panels-configure-value-mappings.md).

## Time series data with thresholds
<a name="v12-panels-state-timeline-threshold"></a>

The visualization can be used with time series data as well. In this case, the thresholds are used to turn the time series into discrete colored state regions.

## Legend options
<a name="v12-panels-state-timeline-legend"></a>

When the legend option is enabled, it can show either the value mappings or the threshold brackets. To show the value mappings in the legend, it’s important that the **Color scheme** option under Standard options is set to **Single color** or **Classic palette**. To see the threshold brackets in the legend, set the **Color scheme** to **From thresholds**.

**Legend mode**

Use these settings to define how the legend appears in your visualization. For more information about the legend, refer to [Configure a legend](v12-panels-configure-legend.md).
+ **List** – Displays the legend as a list. This is the default mode.
+ **Table** – Displays the legend as a table.
+ **Hidden** – Hides the legend.

**Legend placement**

Choose where to display the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Legend values**

Choose which of the [standard calculations](v12-panels-calculation-types.md) to show in the legend. You can have more than one.

# Status history
<a name="v12-panels-status-history"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Status histories show periodic states over time. Each field or series is rendered as a horizontal row. Boxes are rendered and centered around each value.

## Supported data
<a name="v12-panels-status-history-supporteddata"></a>

A status history works with string, boolean, and numerical fields or time series. A time field is required. You can use value mappings to color strings or assign text values to numerical ranges.

## Display options
<a name="v12-panels-status-history-options"></a>

Use these options to refine the visualization.

**Show values**

Controls whether values are rendered inside the value boxes. **Auto** will render values if there is sufficient space.

**Column width**

Controls the width of boxes. 1 = maximum space and 0 = minimum space.

**Line width**

Controls line width of state regions.

**Fill opacity**

Controls the fill opacity of state regions.

## Value mappings
<a name="v12-panels-status-history-valuemap"></a>

To assign colors to boolean or string values, use [Configure value mappings](v12-panels-configure-value-mappings.md).

## Time series data with thresholds
<a name="v12-panels-status-history-threshold"></a>

The panel can be used with time series data as well. In this case, the thresholds are used to color the boxes. You can also use gradient color schemes to color values.

## Legend options
<a name="v12-panels-status-history-legend"></a>

When the legend option is enabled, it can show either the value mappings or the threshold brackets. To show the value mappings in the legend, it’s important that the **Color scheme** option under Standard options is set to **Single color** or **Classic palette**. To see the threshold brackets in the legend, set the **Color scheme** to **From thresholds**.

**Legend mode**

Use these settings to define how the legend appears in your visualization. For more information about the legend, refer to [Configure a legend](v12-panels-configure-legend.md).
+ **List** – Displays the legend as a list. This is the default mode.
+ **Table** – Displays the legend as a table.
+ **Hidden** – Hides the legend.

**Legend placement**

Choose where to display the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Legend values**

Choose which of the [standard calculations](v12-panels-calculation-types.md) to show in the legend. You can have more than one.

# Table
<a name="v12-panels-table"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Tables are very flexible, supporting multiple modes for time series and for tables, annotation, and raw JSON data. This visualization also provides date formatting, value formatting, and coloring options, including CSS cell styling, tooltip generation from table fields, a new Actions cell type for interactive buttons, auto-formatted cell values in Cell Inspect, and row-level conditional formatting for coloring entire rows based on data values.

![\[An image showing an example of a table visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/table_example.png)


**Note**  
Annotations and alerts are not supported in tables.

## Sort column
<a name="v12-panels-table-sort"></a>

Choose a column title to change the sort order from default to descending to ascending. Each time you select the column, the sort order changes to the next option in the cycle. You can sort on multiple columns by holding the `shift` key when selecting additional columns.

## Table options
<a name="v12-panels-table-options"></a>

**Show header**

Show or hide column names imported from your data source.

## Column width
<a name="v12-panels-table-width"></a>

By default, Grafana automatically calculates the column width based on the table size and the minimum column width. This field option can override the setting and define the width for all columns in pixels.

For example, if you enter `100`, all the columns will be set to 100 pixels wide (the change takes place when you exit the field).

## Minimum column width
<a name="v12-panels-table-min"></a>

By default, the minimum width of the table column is 150 pixels. This field option can override that default and will define the new minimum column width for the table panel in pixels.

For example, if you set the minimum to `75`, all the columns will scale to no smaller than 75 pixels wide.

For small-screen devices, such as smartphones or tablets, you can reduce the default `150` pixel value to `50` to allow table based panels to render correctly in dashboards.

## Column alignment
<a name="v12-panels-table-alignment"></a>

Choose how Grafana should align cell contents.
+ Auto (default)
+ Left
+ Center
+ Right

## Cell type
<a name="v12-panels-table-cell-type"></a>

By default, Grafana automatically chooses display settings. You can override the settings by choosing one of the following options to set the default for all fields. Additional configuration is available for some cell types.

**Note**  
If you set these in the **Field** tab, then the type will apply to all fields, including the time field. You can set them in the **Override** tab to apply the change to one or more fields.

**Color text**

If thresholds are set, then the field text is displayed in the appropriate threshold color.

**Color background (gradient or solid)**

If thresholds are set, then the field background is displayed in the appropriate threshold color.

**Gauge**

Cells can be displayed as a graphical gauge, with several different presentation types.
+ *Basic* – The basic mode will show a simple gauge with the threshold levels defining the color of gauge.
+ *Gradient* – The threshold levels define a gradient.
+ *LCD* – The gauge is split up in small cells that are lit or unlit.

Additionally, labels displayed alongside the gauges can be set to be colored by value, match the theme text color, or be hidden.
+ **Value color**
+ **Text color**
+ **Hidden**

**JSON view**

Shows value formatted as code. If a value is an object the JSON view allowing browsing the JSON object will appear on hover.

**Sparkline**

Shows values rendered as a sparkline. Requires [time series to table](v12-panels-xform-functions.md#v12-panels-xform-funcs-series) data transform.

## Cell value inspect
<a name="v12-panels-table-cell-value"></a>

Enables value inspection from table cell. The raw value is presented in a modal window.

**Note**  
Cell value inspection is only available when cell display mode is set to Auto, Color text, Color background, or JSON View.

## Column filter
<a name="v12-panels-table-col-filter"></a>

You can temporarily change how column data is displayed. For example, you can order values from highest to lowest or hide specific values. For more information, see [Filter table columns](#v12-panels-table-filter).

## Pagination
<a name="v12-panels-table-pagination"></a>

Use this option to enable or disable pagination. It is a front-end option that does not affect queries. When enabled, the page size automatically adjusts to the height of the table.

## Filter table columns
<a name="v12-panels-table-filter"></a>

If you turn on the **Column filter**, then you can filter table options.

**To turn on column filtering**

1. In Grafana, navigate to the dashboard with the table with the columns that you want to filter.

1. On the table panel you want to filter, open the panel editor.

1. Choose the **Field** tab.

1. In **Table** options, turn on the **Column filter** option.

A filter (funnel) icon appears next to each column title.

**Filter column values**

To filter column values, choose the filter (funnel) icon next to a column title. Grafana displays the filter options for that column.

Choose the check box next to the values that you want to display. Enter text in the search field at the top to show those values in the display so that you can select them rather than scroll to find them.

Select from several operators to display column values:
+ **Contains** – Matches a regex pattern (operator by default).
+ **Expression** – Evaluates a Boolean expression. The character `$` represents the column value in the expression (for example, `$ >= 10 ≈& $ <= 12`).
+ **Comparison operators** – You can use the typical comparison operators: `=`, `!=`, `<`, `<=`, `>`, `>=`.

Choose the checkbox above the **Ok** and **Cancel** buttons to add or remove all displayed values from the filter.

**Clear column filters**

Columns with filters applied have a blue funnel displayed next to the title.

To remove the filter, choose the blue funnel icon and then select **Clear filter**.

## Table footer
<a name="v12-panels-table-footer"></a>

You can use the table footer to show [calculations](v12-panels-calculation-types.md) on fields.

After you enable the table footer, you can select the **Calculation**, and then the **Fields** that you want to calculate.

The system applies the calculation to all numeric fields if you do not select a field.

**Count rows**

If you want to show the number of rows in the dataset instead of the number of values in the selected fields, select the **Count** calculation and enable **Count rows**.

# Text
<a name="v12-panels-text"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Text visualizations enable you to directly include text or HTML in your dashboards. This can be used to add contextual information and descriptions or embed complex HTML.

**Mode**

**Mode** determines how embedded content appears. It has the following options:
+ **Markdown** – This option formats the content as markdown.
+ **HTML** – This setting renders the content as sanitized HTML.
+ **Code** – This setting renders content inside a read-only code editor. Select an appropriate language to apply syntax highlighting to the embedded text.

**Variables**

Variables in the content will be expanded for display.

# Time series
<a name="v12-panels-time-series"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

![\[An image showing examples of times series visualizations in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/time_series_example.png)


Time series visualizations are the default and primary way to visualize time series data as a graph. They can render series as lines, points, or bars. They're versatile enough to display almost any time-series data.

**Note**  
You can migrate Graph panel visualizations to Time series visualizations. To migrate, on the **Panel** tab, choose **Time series visualization**. Grafana transfers all applicable settings.

**Topics**
+ [Tooltip options](v12-time-series-panel-tooltip.md)
+ [Legend options](v12-time-series-panel-legend.md)
+ [Graph styles](v12-time-series-graph.md)
+ [Axis options](v12-time-series-axis.md)
+ [Color options](v12-time-series-color.md)

# Tooltip options
<a name="v12-time-series-panel-tooltip"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Tooltip options control the information overlay that appears when you hover over data points in the graph.

**Tooltip mode**
+ **Single** – The hover tooltip shows only a single series, the one that you are hovering over.
+ **All** – The hover tooltip shows all series in the visualization. Grafana highlights the series that you are hovering over in bold in the series list in the tooltip.
+ **Hidden** – Do not display the tooltip when you interact with the visualization.

# Legend options
<a name="v12-time-series-panel-legend"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Legend options control the series names and statistics that appear under or to the right of the graph.

**Legend mode**

Use these settings to define how the legend appears in your visualization. For more information about the legend, see [Configure a legend](v12-panels-configure-legend.md).
+ **List** – Displays the legend as a list. This is the default display mode of a legend.
+ **Table** – Displays the legend as a table.
+ **Hidden** – Hides the legend.

**Legend placement**

Choose where to display the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Legend values**

Choose which of the [standards calculations](v12-panels-calculation-types.md) to show in the legend. You can have more than one.

# Graph styles
<a name="v12-time-series-graph"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Use this option to define how to display your time series data. You can use overrides to combine multiple styles in the same graph.
+ **Lines** – Display the time series as a line on a graph.
+ **Bars** – Display the time series as a series of bars on a graph, one for each data point.
+ **Points** – Display the time series as dots on a graph, one for each data point.

## Bar alignment
<a name="v12-time-series-graph-bar"></a>

Set the position of the bar relative to a data point.where the point would be drawn on the graph. Because a bar has a width, it can be placed before, after, or centered on the point. The choices for this option are:
+ ![\[An image showing a bar graph aligned before a point.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/bar-alignment-before.png) **Before** – The bar is drawn before the point. The point is placed on the trailing corner of the bar.
+ ![\[An image showing a bar graph aligned around a point.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/bar-alignment-center.png) **Center** – The bar is drawn around the point. The point is placed in the center of the bar. This is the default.
+ ![\[An image showing a bar graph aligned after a point.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/bar-alignment-after.png) **After** – The bar is drawn after the point. the point is placed on the leading corner of the bar.

## Line width
<a name="v12-time-series-graph-linewidth"></a>

Line width is a slider that controls the thickness for series lines or the outline for bars.

## Fill opacity
<a name="v12-time-series-graph-fill"></a>

Sets the opacity of a fill color. Fills are used, for example, to show the area under the line in a line graph, or as the color of bars in a bar graph.

## Gradient mode
<a name="v12-time-series-graph-gradient"></a>

Gradient mode specifies the gradient fill, which is based on the series color. To change the color, use the standard color scheme field option. For more information, see [Color scheme](v12-panels-configure-standard-options.md#v12-panels-standard-options-color-scheme).

The gradient mode options are:
+ **None** – No gradient fill. This is the default setting.
+ **Opacity** – An opacity gradient where the opacity of the fill increases as the Y-axis values increase.
+ **Hue** – A subtle gradient that is based on the hue of the series color.
+ **Scheme** – A color gradient defined by your color scheme. This setting is used for the fill area and the line. For more information, see [Color options](v12-time-series-color.md).

The gradient appearance is influenced by the **Fill opacity** setting.

## Show points
<a name="v12-time-series-graph-showpoints"></a>

You can configure your visualization to add points to line or bars, with the following options.
+ **Auto** – Grafana determines whether to show points based on the density of the data. Points are shown when the density is low.
+ **Always** – Points are shown, regardless of the data density.
+ **Never** – Do not show points.

## Point size
<a name="v12-time-series-graph-pointsize"></a>

Sets the size of the points, from 1 to 40 pixels in diameter.

## Line interpolation
<a name="v12-time-series-graph-interpolation"></a>

Choose how Grafana interpolates the series line.

![\[An image showing different ways of drawing lines between points in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/line-interpolation.png)


The options are:
+ **Linear** – Points are joined by straight lines.
+ **Smooth** – Points are joined by curved lines that smooths transitions between points.
+ **Step before** – The line is displayed as steps between points. Points are rendered at the end of the step.
+ **Step after** – The line is displayed as steps between points. Points are rendered at the beginning of the step.

## Line style
<a name="v12-time-series-graph-linestyle"></a>

Set the style of the line. To change the color, use the standard color scheme field option.

The choices for line style are:
+ **Solid** – Display a solid line. This is the default setting.
+ **Dash** – Display a dashed line. When you choose this option, a list appears for you to select the length and gap (length, gap) for the line dashes. Dash spacing is set to 10, 10 by default.
+ **Dots** – Display dotted lines. When you choose this option, a list appears for you to select the gap length for the dot spacing. Dot spacing is set to 10 by default.

## Connect null values
<a name="v12-time-series-graph-null"></a>

Choose how null values, which are gaps in the data, appear on the graph. Null values can be connected to form a continuous line, or set to a threshold above which gaps in the data are no longer connected.

The choices for how to connect null values are:
+ **Never** – Time series data points with gaps in the data are never connected.
+ **Always** – Time series data points with gaps in the data are always connected.
+ **Threshold** – Specify a threshold above which gaps in the data are no longer connected. This can be useful when the connected gaps in the data are of a known size or within a known range, and gaps outside the range should no longer be connected.

## Disconnect values
<a name="v12-time-series-graph-disconnect"></a>

Choose whether to add a gap between values in the data that have times between them above a specified threshold.

The choices for disconnect values are are:
+ **Never** – Time series data points are never disconnected.
+ **Threshold** – Specify a threshold above which values in the data are disconnected. This can be useful when desired values in the data are of a known size or within a known range, and values outside this range should no longer be connected.

## Stack series
<a name="v12-time-series-graph-stack"></a>

*Stacking* allows Grafana to display series on top of each other. Be cautious when using stacking in the visualization as it can easily create misleading graphs. To read more about why stacking might not be the best approach, refer to [The Issue with Stacking](https://www.data-to-viz.com/caveat/stacking.html).

The choices for stacking are:
+ **Off** – Turns off series stacking.
+ **Normal** – Stacks series on top of each other.
+ **100%** – Stack by percentage, where all series together add up to 100%.

**Stacking series in groups**

You can override the stacking behavior to stack series in groups. For more information about creating an override, see [Configure field overrides](v12-panels-configure-overrides.md).

**To stack series in groups**

1. Edit the panel and choose **Overrides**.

1. Create a field override for the **Stack series** option.

1. In stacking mode, select **Normal**.

1. Name the stacking group in which you want the series to appear.

   The stacking group name option is only available when you create an override.

## Fill below to
<a name="v12-time-series-graph-fillbelow"></a>

The **Fill below to** option fills the area between two series. This options is only available as a series or field override.

Using this option you can fill the area between two series, rather than from the series line down to 0. For example, if you had two series called *Max* and *Min*, you could select the *Max* series and override it to **Fill below to** the *Min* series. This would fill only the area between the two series lines.

# Axis options
<a name="v12-time-series-axis"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Options under the axis category change how the x- and y-axes are rendered. Some options do not take effect until you click outside of the field option box you are editing. You can also press `Enter`.

## Time zone
<a name="v12-time-series-axis-timezone"></a>

Set the desired time zones to display along the x-axis.

## Placement
<a name="v12-time-series-axis-placement"></a>

Select the placement of the Y-axis. The options are:
+ **Auto** – Automatically assigns the y-axis to the series. When there are two or more series with different units, Grafana assigns the left axis to the first unit, and the right axis to the units that follow.
+ **Left** – Display all y-axes on the left side.
+ **Right** – Display all y-axes on the right side.
+ **Hidden** – Hide all axes.

To selectively hide axes, [add a field override](v12-panels-configure-overrides.md) that targets specific fields.

## Label
<a name="v12-time-series-axis-label"></a>

Set a y-axis text label. If you have more than one y-axis, then you can assign different labels using an override.

## Width
<a name="v12-time-series-axis-width"></a>

Set a fixed width of the axis. By default, Grafana dynamically calculates the width of an axis.

By setting the width of the axis, data with different axes types can share the same display proportions. This setting makes it easier for you to compare more than one graph’s worth of data because the axes are not shifted or stretched within visual proximity to each other.

## Show grid lines
<a name="v12-time-series-axis-gridlines"></a>

Set the axis grid line visibility.
+ **Auto** – Automatically show grid lines based on the density of the data.
+ **On** – Always show grid lines.
+ **Off** – Never show grid lines.

## Color
<a name="v12-time-series-axis-color"></a>

Set the color of the axis.
+ **Text** – Set the color based on theme text color.
+ **Series** – Set the color based on the series color.

## Show border
<a name="v12-time-series-axis-border"></a>

Set the axis border visibility.

## Scale
<a name="v12-time-series-axis-scale"></a>

Set how the y-axis values scale.
+ **Linear** – Divides the scale into equal parts.
+ **Logarithmic** – Use a logarithmic scale. When you select this option, a list appears for you to choose a binary (base 2) or common (base 10) logarithmic scale.
+ **Symlog** – Use a symmetrical logarithmic scale. When you select this option, a list appears for you to choose a binary (base 2) or common (base 10) logarithmic scale. The linear threshold option allows you to set the threshold at which the scale changes from linear to logarithmic.

## Centered zero
<a name="v12-time-series-axis-centered"></a>

Sets the y-axis to be centered on zero.

## Soft min and soft max
<a name="v12-time-series-axis-softminmax"></a>

Set a **Soft min** or **soft max** option for better control of y-axis limits. By default, Grafana sets the range for the y-axis automatically based on the dataset.

Soft min and soft max settings can prevent small variations in the data from being magnified when it's mostly flat. In contrast, hard min and max values help prevent obscuring useful detail in the data by clipping intermittent spikes past a specific point.

To define hard limits of the y-axis, set standard min/max options. For more information, refer to [Configure standard options](v12-panels-configure-standard-options.md).

## Transform
<a name="v12-time-series-axis-transform"></a>

Use this option to transform the series values without affecting the values shown in the tooltip, context menus, or legend. You have two transform options:
+ **Negative Y transform** – Flip the results to negative values on the Y axis.
+ **Constant** – Show the first value as a constant line.

**Note**  
The transform option is only available as an override.

## Display multiple y-axes
<a name="v12-time-series-axis-multiple"></a>

There are some cases where you want to display multiple y-axes. For example, if you have a dataset showing both temperature and humidity over time, you could show two y-axes with different units for these two series.

To display multiple y-axes, [add a field override](v12-panels-configure-overrides.md#v12-panels-overrides-add-a-field). Follow the steps as many times as required to add as many y-axes as you need.

# Color options
<a name="v12-time-series-color"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

By default, the graph uses the standard [Color scheme](v12-panels-configure-standard-options.md#v12-panels-standard-options-color-scheme) option to assign series colors. You can also use the legend to open the color picker by selecting the legend series color icon. Setting color this way automatically creates an override rule that set’s a specific color for a specific series.

The following are additional options that you can use to override series color defaults.

## Classic palette
<a name="v12-time-series-color-classic"></a>

The most common setup is to use the **Classic palette** for graphs. This scheme automatically assigns a color for each field or series based on its order. If the order of a field changes in your query, the color also changes. You can manually configure a color for a specific field using an override rule.

## Single color
<a name="v12-time-series-color-single"></a>

Use this mode to specify a color. You can also select the colored line icon next to each series in the Legend to open the color picker. This automatically creates a new override that sets the color scheme to single color and the selected color.

## By value color schemes
<a name="v12-time-series-color-byvalue"></a>

If you select a by value color scheme like **From thresholds (by value)** or **Green-Yellow-Red (by value)**, the **Color series by** option appears. This option controls which value (Last, Min, Max) to use to assign the series its color.

## Scheme gradient mode
<a name="v12-time-series-color-gradient"></a>

The **Gradient mode** option located under the **Graph styles** has a mode named **Scheme**. When you enable **Scheme**, the line or bar receives a gradient color defined from the selected **Color scheme**.

**From thresholds**

If the **Color scheme** is set to **From thresholds (by value)** and **Gradient mode** is set to **Scheme**, then the line or bar color changes as they cross the defined thresholds. You will see only the exact colors chosen in the scheme.

**Gradient color schemes**

Using a gradient color scheme *without* setting the **Gradient mode** to **Scheme**, means that the colors chosen will form a gradient between the colors chosen, as the values in the series move between the thresholds set.

# Traces
<a name="v12-panels-traces"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Traces visualizations let you follow a request as it traverses the services in your infrastructure. The traces visualization displays traces data in a diagram that allows you to easily interpret it.

For more information about traces and how to use them, refer to the following documentation:
+ [Tracing in Explore](v12-explore-tracing.md)
+ [Tempo data source](tempo-data-source.md)
+ [Getting started with Tempo](https://grafana.com/docs/tempo/latest/getting-started/) in the *Grafana Labs Tempo Documentation*.

## Adding a panel with tracing visualizations
<a name="v12-panels-traces-add"></a>

Once you have tracing data available in your Grafana stack, you can add tracing panels to your Grafana dashboards.

Using a dashboard variable, `traceID`, lets you create a query to show specific traces for a given trace ID. For more information about dashboard variables, refer to the [Variables documentation](v12-dash-variables.md). 

**Prerequisites**

Before you begin, you need:
+ An Amazon Managed Grafana workspace.
+ A [Tempo data source](tempo-data-source.md) connected to your workspace.

To view and analyze traces data in a dashboard, you need to add the traces visualization to your dashboard and define a query using the panel editor. The query determines the data that is displayed in the visualization. For more information on the panel editor, refer to the [Panel editor documentation](v12-panels-editor-overview.md).

This procedure uses dashboard variables and templates to allow you to enter trace IDs which can then be visualized. You’ll use a variable called `traceId` and add it as a template query.

**To add a traces visualization query**

1. In your workspace, create a new dashboard or go to an existing dashboard where you’d like to add traces visualizations.

1. Choose **Add visualization** from a new dashboard or choose **Add Panel** on an existing dashboard.

1. Select the appropriate tracing data source.

1. In the top-right of the panel editor, choose the **Visualizations** tab, and select **Traces**.

1. Under the **Panel options**, enter a **Title** for your trace panel. For more information on the panel editor, see [Configure panel options](v12-panels-configure-panel-options.md).

1. In the query editor, select the **TraceQL** query type tab.

1.  Enter `${traceId}` in the TraceQL query field to create a dashboard variable. This variable is used as the template query.

1. Choose **Apply** in the panel editor to add the panel to the dashboard.

1. Go to the dashboard **Settings** and add a new variable called `traceId`, of variable type **Custom**, giving it a label, if required. Choose **Apply** to add the variable to the dashboard.

1. Verify that the panel works by using a valid trace ID for the data source used for the trace panel and editing the ID in the dashboard variable.

## Adding TraceQL with table visualizations
<a name="v12-panels-traces-traceql"></a>

While you can add a trace visualization to a dashboard, having to manually add trace IDs as a dashboard variable is cumbersome. It’s more useful to instead be able to use TraceQL queries to search for specific types of traces and then select appropriate traces from matching results.

**Prerequisites**

This procedure assumes you have completed the previous procedure.

**To add TraceQL with table visualizations**

1. In the same dashboard where you added the trace visualization, choose **Add panel** to add a new visualization panel.

1. Select the same trace data source you used in the previous section.

1. In the top-right of the panel editor, select the **Visualizations** tab, then choose **Table**.

1. In the query editor, choose the **TraceQL** tab.

1. Under the **Panel options**, enter a **Title** for your trace panel.

1. Add an appropriate TraceQL query to search for traces that you would like to visualize in the dashboard. For example, here is a simple, static query from a server called *my-server*.

   ```
   { .service.name = "my-server" && .http.status_code=500 }
   ```

   You can write the TraceQL query as a template query to take advantage of other dashboard variables, if they exist. This lets you create dynamic queries based on these variables.

When results are returned from a query, the results are rendered in the panel’s table.

The results in the traces visualization include links to the **Explore** page that renders the trace. You can add other links to traces in the table that fill in the `traceId` dashboard variable when selected, so that the trace is visualized in the same dashboard.

To create a set of data links in the panel, use the following procedure.

**To use a variable to add other links to traces**

1. In the right-side menu, under **Data links**, choose **Add link**.

1. Add a **Title** for the data link.

1. Find the path to the dashboard by looking in your browser’s address bar when the full dashboard is being rendered. Because this is a link to a dashboard in the same Grafana stack, only the path of the dashboard is required.

   For example, if your path is:

   ```
   https://g-example.grafana-workspace.us-east-1.amazonaws.com/d/1234abcd5/my-dashboard?orgId=1
   ```

   Then the path to the dashboard is:

   ```
   /d/1234abcd5/my-dashboard?orgId=1
   ```

1. In the **URL** field, make a self-reference to the dashboard that contains both of the panels. This self-reference uses the value of the selected trace in the table to fill in the dashboard variable. Use the path for the dashboard from the previous step and then fill in the value of `traceId` using the selected results from the TraceQL table. The trace ID is exposed using the `traceID` data field in the returned results, so use that as the value for the dashboard variable. For example:

   ```
   /d/1234abcd5/my-dashboard?orgId=1&var-traceId=${__data.fields["traceID"]}
   ```

1. Choose **Save** to save the data link.

1. Choose **Apply** from the panel editor to apply the panel to the dashboard.

1. Save the dashboard.

You should now see a list of matching traces in the table visualization. While selecting the **TraceID** or **SpanID** fields will give you the option to either open the **Explore** page to visualize the trace or following the data link, selecting any other field (such as `Start time`, `Name`, or `Duration`) automatically follows the data link, filling in the `traceId` dashboard variable, and then shows the relevant trace in the trace panel. 

# Trend
<a name="v12-panels-trend"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Trend visualizations should be used for datasets that have a sequential, numeric X that is not time. Some examples are function graphs, rpm/torque curves, supply/demand relationships, and elevation or heart rate plots along a race course (with x as distance or duration from start).

Trend visualizations support all visual styles and options available in the [time series visualization](v12-panels-time-series.md) with the following exceptions:
+ No annotations or time regions
+ No shared cursor (or crosshair)
+ No multi-timezone x axis
+ No ability to change the dashboard time range via drag-selection

**X Field selection**

Use this option to select a field that contains increasing numeric values.

 For example, you could represent engine power and torque versus speed where speed is plotted on the x axis and power and torque are plotted on the y axes.

# XY Chart
<a name="v12-panels-xychart"></a>

XY charts provide a way to visualize arbitrary x and y values in a graph so that you can easily show the relationship between two variables. XY charts are typically used to create scatter plots. you can also use them to create bubble charts, where field values determine the size of each bubble.

![\[An image showing an example of an XY chart visualization in Grafana.\]](http://docs.aws.amazon.com/grafana/latest/userguide/images/viz/xy-chart-example.png)


## Supported data formats
<a name="v12-panels-xychart-formats"></a>

You can use any type of tabular data with at least two numeric fields in an XY chart. This type of visualization doesn't require time data.

## Panel options
<a name="v12-panels-xychart-paneloptions"></a>

In the **Panel options** section of the panel editor pane, you set basic options like the panel title and description. You can also configure repeating panels in this section. For more information, see [Configure panel options](v12-panels-configure-panel-options.md).

## XY chart options
<a name="v12-panels-xychart-options"></a>

**Series mapping**

Set how series data is mapped in the chart.
+ **Auto** – Automatically generates series from all available data frames (or datasets). You can filter to select only one frame.
+ **Manual** – Explicitly define the series by selecting from available data frames.

Depending on your series mapping selection, the **Frame**, **X-field**, and **Y-field** options differ. The Auto and Manual series mapping sections describe these different options.

**Auto series mapping options**

When you select **Auto** as your series mapping mode, the following options are preconfigured, but you can also define them yourself.
+ **Frame** – By default an XY chart displays all data frames. You can filter to select only one frame.
+ **X-field** – Select which field X represents. By default,t his is the first number field in each data frame.
+ **Y-field** – After the X-field is set, by default, all the remaining number fields in the data frame are designated as the Y-fields. You can use this option to explicitly choose which fields to use for Y.

  The series of the chart are generated from the Y-fields. To make changes to a series in an XY chart, make overrides to the Y-field. Any field you use in the Size field or Color field doesn't generate a series.

  You can also use overrides to exclude Y-fields individually. To do so, add an override with the following properties for each Y-field you want removed:
  + Override type: **Fields with name**
  + Override property: **Series > Hide in area**
  + Area: **Viz**

**Manual series mapping options**

When you select **Manual** as your series mode, you can add, edit, and delete series. To manage a series, select the **Series** field. To rename the series, select the series name.

In **Manual** mode, you must set the following options:
+ **Frame** – Select your data frame or dataset. You can add as many frames as you want.
+ **X-field** – Select which field X represents.
+ **Y-field** – Select which field Y represents.

**Size field**

Use this option to set which field's values control the size of point in the chart. This value is relative to the min and max of all the values in the data frame.

When you select this option, you can then set the min and max point size options.

**Color field**

Use this option to set which field's values control the color of the points in the chart. To use the color value options under the **Standard options**, you must set this field.

Typically, this option is used when you only have one series displayed in the chart.

**Show**

Set how values are represented in the visualization.
+ **Points** – Display values as points. When you select this option, the point size option is also displayed.
+ **Lines** – Add a line between values. When you select this option, the line style and line width options are also displayed.
+ **Both** – Display both points and lines.

**Point size**

Sets the size of all point in the chart, from one to 100 pixels in diameter. The default size is five pixels. You can set an override to set the pixel size by series (Y-field).

**Min/Max point size**

Use these optinos to control the minimum or maximum point size when you've set the **Size field** option. You can override these options for specific series.

**Line style**

Set the style of the line. To change the color, use the standard color scheme field option.
+ **Solid** – Display a solid line. This is the default setting.
+ **Dash** – Display a dashed line. When you choose this option, a drop-down list is displayed where you can select the length and gap setting for the line dashes. By default, the length and gap are set to `10, 10`.
+ **Dots** – Display dotted lines. When you choose this option, a drop-down list is displayed where you can select dot spacing. By default, the dot spacing is set to `0, 10` (the first number represents dot length, and is always zero).

**Line width**

Sets the width of the lines, in pixels.

## Tooltip options
<a name="v12-panels-xychart-tooltipoptions"></a>

Tooltip options control the information overlay that appears when you hover over data points in the graph.

**Tooltip mode**
+ **Single** – The hover tooltip shows only a single series, the one that you are hovering over.
+ **Hidden** – Do not display the tooltip when you interact with the visualization.

Use an override to hide individual series from the tooltip.

**Max height**

Set the maximum height of the tooltip box. The defautl is 600 pixels.

## Legend options
<a name="v12-panels-xychart-legendoptions"></a>

Legend options control the series names and statistics that appear under or to the right of the graph. For more information about the legend, see [Configure a legend](v12-panels-configure-legend.md).

**Visibility**

Toggle the switch to turn the legend on or off.

**Mode**

Use these settings to define how the legend appears in your visualization.
+ **List** – Displays the legend as a list. This is the default display mode of a legend.
+ **Table** – Displays the legend as a table.

**Placement**

Choose where to display the legend.
+ **Bottom** – Below the graph.
+ **Right** – To the right of the graph.

**Values**

Choose which of the [standards calculations](v12-panels-calculation-types.md) to show in the legend. You can have more than one.

**Width**

Control how wide the legend is when place to the right side of the visualization. This option is only displayed if you set the legend placement to **Right**.

## Axis options
<a name="v12-panels-xychart-axis"></a>

****  
This documentation topic is designed for Grafana workspaces that support **Grafana version 12.x**.  
For Grafana workspaces that support Grafana version 10.x, see [Working in Grafana version 10](using-grafana-v10.md).  
For Grafana workspaces that support Grafana version 9.x, see [Working in Grafana version 9](using-grafana-v9.md).  
For Grafana workspaces that support Grafana version 8.x, see [Working in Grafana version 8](using-grafana-v8.md).

Options under the axis category change how the x- and y-axes are rendered. Some options don't take effect until you click outside of the field option box you are editing. You can also press `Enter`.

**Placement (y-axis)**

Select the placement of the Y-axis. The options are:
+ **Auto** – Automatically assigns the y-axis to the series. When there are two or more series with different units, Grafana assigns the left axis to the first unit, and the right axis to the units that follow.
+ **Left** – Display all y-axes on the left side.
+ **Right** – Display all y-axes on the right side.
+ **Hidden** – Hide all axes.

To selectively hide axes, [add a field override](v12-panels-configure-overrides.md) that targets specific fields.

**Label**

Set a y-axis text label. If you have more than one y-axis, then you can assign different labels using an override.

**Width**

Set a fixed width of the axis. By default, Grafana dynamically calculates the width of an axis.

By setting the width of the axis, data with different axes types can share the same display proportions. This setting makes it easier for you to compare more than one graph’s worth of data because the axes are not shifted or stretched within visual proximity to each other.

**Show grid lines**

Set the axis grid line visibility.
+ **Auto** – Automatically show grid lines based on the density of the data.
+ **On** – Always show grid lines.
+ **Off** – Never show grid lines.

**Color**

Set the color of the axis.
+ **Text** – Set the color based on theme text color.
+ **Series** – Set the color based on the series color.

**Show border**

Set the axis border visibility.

**Scale**

Set how the y-axis values scale.
+ **Linear** – Divides the scale into equal parts.
+ **Logarithmic** – Use a logarithmic scale. When you select this option, a list appears for you to choose a binary (base 2) or common (base 10) logarithmic scale.
+ **Symlog** – Use a symmetrical logarithmic scale. When you select this option, a list appears for you to choose a binary (base 2) or common (base 10) logarithmic scale. The linear threshold option allows you to set the threshold at which the scale changes from linear to logarithmic.

*Centered zero*

Sets the y-axis to be centered on zero.

**Soft min and soft max**

Set a **Soft min** or **soft max** option for better control of y-axis limits. By default, Grafana sets the range for the y-axis automatically based on the dataset.

Soft min and soft max settings can prevent small variations in the data from being magnified when it's mostly flat. In contrast, hard min and max values help prevent obscuring useful detail in the data by clipping intermittent spikes past a specific point.

To define hard limits of the y-axis, set standard min/max options. For more information, refer to [Configure standard options](v12-panels-configure-standard-options.md).

**Transform**

Use this option to transform the series values without affecting the values shown in the tooltip, context menus, or legend. You have two transform options:
+ **Negative Y transform** – Flip the results to negative values on the Y axis.
+ **Constant** – Show the first value as a constant line.

**Note**  
The transform option is only available as an override.

**Display multiple y-axes**

There are some cases where you want to display multiple y-axes. For example, if you have a dataset showing both temperature and humidity over time, you could show two y-axes with different units for these two series.

To display multiple y-axes, [add a field override](v12-panels-configure-overrides.md#v12-panels-overrides-add-a-field). Follow the steps as many times as required to add as many y-axes as you need.

## Standard options
<a name="v12-panels-xychart-standard"></a>

**Standard options** in the panel editor let you change how field data is displayed in your visualization. When you set a standard option, the change is applied to all fields or series. For more granular control over the display of fields, refer to [Configure field overrides](v12-panels-configure-overrides.md).

You can cusotmize the following standard options:
+ **Field min/max** – Enable **Field min/max** to have Grafana calculate the min or max of each field individually, based on the minimum or maximum value of the field.
+ **Color scheme** – Set single or multiple colors for your entire visualization.

For more information, see [Configure standard options](v12-panels-configure-standard-options.md).

## Data links
<a name="v12-panels-xychart-datalinks"></a>

Data links allow you to link to other panels, dashboards, and external resources while maintaining the context of the source panel. You can create links that include the series name or even the value under the cursor.

For each data link, set the following options:
+ **Title**
+ **URL**
+ **Open in new tab**

For more information, see [Configure data links](v12-panels-configure-data-links.md).

## Field overrides
<a name="v12-panels-xychart-fieldoverrides"></a>

Overrides allow you to customize visualization settings for specific fields or series. When you add an override rule, you can target a particular set of fields and define multiple options for how those fields are displayed.

Choose from one of the following override options:
+ **Fields with name** – Select a field from the list of all available fields.
+ **Fields with name matching regex** – Specify fields to override with a regular expression.
+ **Fields with type** – Select fields by type, such as string, numeric, or time.
+ **Fields returned by query** – Select all fields returned by a specific query.
+ **Fields with values** – Select all fields returned by your defined reducer condition, such as **Min**, **Max**, **Count**, or **Total**.

For more information, see [Configure field overrides](v12-panels-configure-overrides.md).