# Single-metric gauge chart

Create a single-metric gauge chart to display a ratio of a single metric in relation to the total.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-18077e0fc0d6d7601352ae896b094f12be3627ce%2Fdash-1668006056.png?alt=media" alt="single-metric gauge chart"><figcaption></figcaption></figure>

## Data shape <a href="#single-metricgaugechart-datashape" id="single-metricgaugechart-datashape"></a>

`<metric value>, <total>`

## NQL structure <a href="#single-metricgaugechart-nqlexamples" id="single-metricgaugechart-nqlexamples"></a>

{% hint style="info" %}
Refer to the [Live Dashboards NQL examples](https://docs.nexthink.com/platform/user-guide/live-dashboards-nql-examples#livedashboardsnqlexamples-single-metricgaugechart) documentation for query examples of single-metric gauge widgets.
{% endhint %}

```
<devices|users>
| include <event table>
| compute temp_bad_number = <device|user>.count()
| summarize 
   <metric> = temp_bad_number.sum(), 
   <total> = count()
```

## Configuring visualization fields specific to single-metric gauges <a href="#linechart-linechartspecificsettings" id="linechart-linechartspecificsettings"></a>

{% hint style="info" %}
Refer to the [Managing Live Dashboards](https://docs.nexthink.com/platform/user-guide/managing-live-dashboards#filling-in-widget-visualization-fields) documentation to learn how to fill in the remaining configuration fields that are not specific to this widget.
{% endhint %}

After selecting the **Single metric gauge chart** option from the **Chart type** dropdown in the [Add widget](https://docs.nexthink.com/platform/user-guide/managing-live-dashboards#adding-widgets)/[Edit a widget](https://docs.nexthink.com/platform/user-guide/managing-live-dashboards#managing-widgets) pop-up:

1. Use the **Label (optional)** field to create the visible name of the single-metric gauge.
   * The text can contain special characters. There is a 50-character limit on the **Label** field.
2. Enter a **Widget description (optional)** to explain, for example, how the metric should be interpreted, calculated, or any subtleties to the metric.
   * The widget description appears by hovering over the info icon next to the single-metric gauge widget in the dashboard.
3. **Choose an output color** for the gauge based on the data to define:
   * Bad (red)
   * Average (yellow)
   * Good (green)
4. Alternatively, establish **Rating** thresholds to change the gauge color if the metric value exceeds the defined limits, allowing for quick identification of issues. Choose from:
   * **1 threshold**: the single-metric gauge chart is either green or red, depending on whether the metric exceeds the given threshold.

     <figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-6001d4d1a724c1d12e118998ebb9e168b1ebebf7%2Fdash-1679651164.png?alt=media" alt="One threshold rating" width="680"><figcaption></figcaption></figure>

     * The system evaluates thresholds with the >= operator. The example above is evaluated as follows:
       * **Good**: if the metric is < 35
       * **Bad**: if the metric is >= 35
     * Select **Invert** to invert the good and bad conditions. When inverted, the example above is evaluated as follows:
       * **Bad**: if the metric is < 35
       * **Good**: if the metric is >= 35
   * **2 thresholds**: the single-metric gauge chart is either green, yellow or red, depending on whether the metric exceeds the given thresholds.

     <figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-627dd4949ec54355beb457405a42b71c7a47e6aa%2Fdash-1679651345.png?alt=media" alt="Two threshold rating" width="680"><figcaption></figcaption></figure>

     * The system evaluates thresholds with the >= operator. The example above is evaluated as follows:
       * **Good**: if the metric is < 35
       * **Average**: if the metric is >= 35 AND the metric is < 65
       * **Bad**: if the metric is >= 65
     * Select **Invert** to invert the good and bad conditions. When inverted, the example above is evaluated as follows:
       * **Bad**: if the metric is < 35
       * **Average**: if the metric is >= 35 AND the metric is < 65
       * **Good**: if the metric is >= 65

***

RELATED TOPIC

* [KPI](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/kpi)
* [Line chart](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/line-chart)
* [Bar chart](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/bar-chart)
* [Multi-metric gauge chart](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/multi-metric-gauge-chart)
* [Table](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/table)
* [Heading](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/heading)
* [Filter widget](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/filter-widget)
* [Timeframe picker](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/timeframe-picker)
