Docs/panel refactor (#43569)
* new refactored panel docs * fixed links * removed xtra sharing link, added links to panel display option tasks * fixed typo * add aliases * incorporate PM feedback * intermediate commit to resolve merge conflict * final changes to resolve merge conflicts
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
+++
|
||||
title = "Format data using value mapping"
|
||||
aliases = ["/docs/grafana/latest/panels/value-mappings/", "/docs/sources/panels/format-data/"]
|
||||
weight = 600
|
||||
+++
|
||||
|
||||
# Format data using value mapping
|
||||
|
||||
In addition to field overrides, value mapping is a technique that you can use to change the visual treatment of data that appears in a visualization.
|
||||
|
||||
{{< section >}}
|
||||
@@ -0,0 +1,52 @@
|
||||
+++
|
||||
title = "About value mapping"
|
||||
weight = 10
|
||||
aliases = ["/docs/sources/panels/format-data/about-value-mapping/"]
|
||||
+++
|
||||
|
||||
# About value mapping
|
||||
|
||||
Value mapping allows you to replace values or ranges in your visualizations with words or emojis.
|
||||
|
||||
Values mapped via value mappings will skip the unit formatting. This means that a text value mapped to a numerical value will not be formatted using the configured unit.
|
||||
|
||||

|
||||
|
||||
If value mappings are present in a panel, then Grafana displays a summary in the side pane of the panel editor.
|
||||
|
||||
> **Note:** The new value mappings are not compatible with some visualizations, such as Graph (old), Text, and Heatmap.
|
||||
|
||||
## Types of value mappings
|
||||
|
||||
Grafana supports the following value mappings:
|
||||
|
||||
- **Value** maps text values to a color or different display text. For example, if a value is `10`, I want Grafana to display **Perfection!** rather than the number.
|
||||
- **Range** maps numerical ranges to a display text and color. For example, if a value is within a certain range, I want Grafana to display **Low** or **High** rather than the number.
|
||||
- **Regex** maps regular expressions to replacement text and a color. For example, if a value is 'www.example.com', I want Grafana to display just **www**, truncating the domain.
|
||||
- **Special** maps special values like `Null`, `NaN` (not a number), and boolean values like `true` and `false` to a display text and color. For example, if Grafana encounters a `null`, I want Grafana to display **N/A**.
|
||||
|
||||
You can also use the dots on the left as a "handle" to drag and reorder value mappings in the list.
|
||||
|
||||
## Time series example
|
||||
|
||||
Here's an example showing a Time series visualization with value mappings. Value mapping colors are not applied to this visualization, but the display text is shown on the axis.
|
||||
|
||||

|
||||
|
||||
## Stat example
|
||||
|
||||
Here's an example showing a Stat visualization with value mappings. You might want to hide the sparkline so it doesn't interfere with the values. Value mapping text colors are applied.
|
||||
|
||||

|
||||
|
||||
## Bar gauge example
|
||||
|
||||
Here's an example showing a Bar gauge visualization with value mappings. The value mapping colors are applied to the text but not the gauges.
|
||||
|
||||

|
||||
|
||||
## Table example
|
||||
|
||||
Here's an example showing a Table visualization with value mappings. If you want value mapping colors displayed on the table, then set the cell display mode to **Color text** or **Color background**.
|
||||
|
||||

|
||||
@@ -0,0 +1,20 @@
|
||||
+++
|
||||
title = "Edit a value mapping"
|
||||
weight = 60
|
||||
aliases = ["/docs/sources/panels/format-data/edit-value-mapping/"]
|
||||
+++
|
||||
|
||||
# Edit a value mapping
|
||||
|
||||
You can change a value mapping at any time.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a panel to a dashboard]({{< relref "../working-with-panels/add-panel.md" >}}).
|
||||
- Ensure you have an existing value mapping to edit.
|
||||
|
||||
**To edit a value mapping**:
|
||||
|
||||
1. Edit the panel that contains the value mapping you want to edit.
|
||||
1. In the panel display options, in the **Value mappings** section, click **Edit value mappings**.
|
||||
1. Make the changes and click **Update**.
|
||||
@@ -0,0 +1,25 @@
|
||||
+++
|
||||
title = "Map a range"
|
||||
weight = 30
|
||||
aliases = ["/docs/sources/panels/format-data/map-a-range/"]
|
||||
+++
|
||||
|
||||
# Map a range
|
||||
|
||||
Map a range of values when you want to format multiple, continuous values.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a panel to a dashboard]({{< relref "../working-with-panels/add-panel.md" >}}).
|
||||
|
||||
**To map a range**:
|
||||
|
||||
1. Edit the panel for which you want to map a range of values.
|
||||
1. In panel display options, in the **Value mappings** section, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Range**.
|
||||
1. Enter the beginning and ending values in the range for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
@@ -0,0 +1,23 @@
|
||||
+++
|
||||
title = "Map a regular expression"
|
||||
weight = 40
|
||||
aliases = ["/docs/sources/panels/format-data/map-a-regular-expression/"]
|
||||
+++
|
||||
|
||||
# Map a regular expression
|
||||
|
||||
Map a regular expression when you want to format the text and color of a regular expression value.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a panel to a dashboard]({{< relref "../working-with-panels/add-panel.md" >}}).
|
||||
|
||||
**To map a regular expression**:
|
||||
|
||||
1. Edit the panel for which you want to map a regular expression.
|
||||
1. In the panel display options, in the **Value mappings** section, click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Regex**.
|
||||
1. Enter the regular expression pattern for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
@@ -0,0 +1,31 @@
|
||||
+++
|
||||
title = "Map a special value"
|
||||
weight = 50
|
||||
aliases = ["/docs/sources/panels/format-data/map-a-special-value/"]
|
||||
+++
|
||||
|
||||
# Map a special value
|
||||
|
||||
Map a special value when you want to format uncommon, boolean, or empty values.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a panel to a dashboard]({{< relref "../working-with-panels/add-panel.md" >}}).
|
||||
|
||||
**To map a special value**:
|
||||
|
||||
1. Edit the panel for which you want to map a special value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Special**.
|
||||
1. Select the special value for Grafana to match. Options include:
|
||||
- Null
|
||||
- NaN (Not a Number)
|
||||
- Null + NaN
|
||||
- True
|
||||
- False
|
||||
- Empty
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
@@ -0,0 +1,25 @@
|
||||
+++
|
||||
title = "Map a value"
|
||||
weight = 20
|
||||
aliases = ["/docs/sources/panels/format-data/map-a-value/"]
|
||||
+++
|
||||
|
||||
# Map a value
|
||||
|
||||
Map a value when you want to format a single value.
|
||||
|
||||
## Before you begin
|
||||
|
||||
- [Add a panel to a dashboard]({{< relref "../working-with-panels/add-panel.md" >}}).
|
||||
|
||||
**To map a value**:
|
||||
|
||||
1. Open a panel for which you want to map a value.
|
||||
1. In panel display options, locate the **Value mappings** section and click **Add value mappings**.
|
||||
1. Click **Add a new mapping** and then select **Value**.
|
||||
1. Enter the value for Grafana to match.
|
||||
1. (Optional) Enter display text.
|
||||
1. (Optional) Set the color.
|
||||
1. Click **Update** to save the value mapping.
|
||||
|
||||

|
||||
Reference in New Issue
Block a user