# Multi-metric gauge chart

Create a multi-metric gauge chart to display a ratio of the good state and the bad state of devices, users, or events.

<figure><img src="https://268444917-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJSUDk9NTtCHYPG5EWs3%2Fuploads%2Fgit-blob-154ac01a26bea4818e0019582f1781e765ef7c03%2Fdash-1666094799.png?alt=media" alt="Gauge widget" width="268"><figcaption></figcaption></figure>

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

`<kpi for good state>, <kpi for bad state>`

## NQL structure <a href="#multi-metricgaugechart-nqlstructure" id="multi-metricgaugechart-nqlstructure"></a>

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

The NQL structure depends on the variable state comparison you set for the multi-metric gauge—good values versus bad values.

For example, the NQL structure below returns the ratio of devices or users with bad events against objects without bad events.

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

The image below displays a gauge using the NQL structure referenced above. The legend labels for good and bad values, come from their corresponding variable names in the NQL query.

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

The variable names are formatted with the following heuristic:

* Underscores are replaced with spaces.
* The first character of the variable is changed to upper-case.

## Configuring visualization fields specific to multi-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 **Multi 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 main gauge.
   * The text can contain special characters. There is a 50-character limit on the **Label** field.
   * See the image in the [NQL structure](#multi-metricgaugechart-nqlstructure) to understand how to define the legend labels for the good and bad values in the query.
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 multi-metric gauge widget in the dashboard.

***

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)
* [Single-metric gauge chart](https://docs.nexthink.com/platform/user-guide/live-dashboards/widget-types/single-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)
