Gauge Indicator

The gauge indicator uses an indicator and a gauge chart and joins them with a bentobox.

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.

The Method To Use

The method is s.plt.gauge_indicator()

It must contain the following input variables:

order: int
value: int

Accepts the following input variables as optional:

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:

s.plt.gauge_indicator(
    order=0,
    value=42,
    title="Gauge Indicator",
    description="composite chart",
)
s.plt.gauge_indicator(
    order=2,
    value=24,
    title="Gauge Indicator",
    description="composite chart",
    color=2
)

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

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:

Last updated