# Gauge Indicator

The gauge indicator uses an indicator and a gauge chart and joins them with a [bentobox](https://docs.shimoku.com/dev/elements/charts/indicators/broken-reference).

{% hint style="info" %}
Each gauge indicator creates a gauge component and an indicator component, so it uses two positions in the grid, the next component has to the the order+2.
{% endhint %}

## The Method To Use <a href="#the-method-to-use" id="the-method-to-use"></a>

The method is `s.plt.gauge_indicator()`

It must contain the following input variables:

```python
order: int
value: int
```

Accepts the following input variables as optional:

```python
title: Optional[str]              # Title that shows in the left
description: Optional[str]        # Text that shows below the title
rows_size: Optional[int]          # How many rows does it occupy, by default = 1
cols_size: Optional[int]          # How many columns does it occupy, by default = 6
color: Union[str, int]            # Color of the gauge
```

## Examples

When we execute this example:

<pre class="language-python"><code class="lang-python">s.plt.gauge_indicator(
<strong>    order=0,
</strong>    value=42,
    title="Gauge Indicator",
    description="composite chart",
)
s.plt.gauge_indicator(
<strong>    order=2,
</strong>    value=24,
    title="Gauge Indicator",
    description="composite chart",
    color=2
)
</code></pre>

<figure><img src="https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FxcdWBSCVZQbBuTV5pDio%2FGauge%20indicators(3).png?alt=media&#x26;token=54e8aa54-bd2d-4134-98be-7ce37c4d5960" alt=""><figcaption><p>Gauge indicators</p></figcaption></figure>

In case we don't have a static limit on how many gauge indicators we have, the following pattern can be useful:

```python
import random

order = 0

for i in range(random.randint(1, 5)):
    s.plt.gauge_indicator(
        order=order, title=f'Gauge Indicatior {i}',
        description='random gauge indicators',
        value=random.randint(0, 100),
        color=random.randint(0, 10),
    )
    order += 2
    
# Use the variable order for the next chart
```

One possible result of executing the previous code is:

<figure><img src="https://3782181538-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlHTfmIZY46Z1EDfyGMz%2Fuploads%2FDRPCuS94Dti7dtQD1amS%2FGauge%20indicators%20random.png?alt=media&#x26;token=01925d9b-91cc-4a9a-9630-22e443f27dcd" alt=""><figcaption><p>Random gauge indicators</p></figcaption></figure>
