# Speedometer

The Speedometer gives a quick view of a specific value and range. It is possible to customize the Speedometer to show different colors depending on set rules for the value.

## General

General data is required for all portlets.

[General configuration](https://help.novacuraflow.com/development/flow-portal-2/common-configuration#general)

## Listeners

The portlet can listen to the following events:

* On Row Selection
* On Refresh
* On Point Selection

The portlet can send the following events:

* On Row Selection
* On Refresh

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M8tbrSaGIRYe9EthohB%2F-M8te-04B8QT7wm13Chg%2Fimage.png?alt=media&#x26;token=7f9a39be-4175-45b1-bdb2-aca3cb828495" alt=""></div>

[Listeners configuration](https://help.novacuraflow.com/development/flow-portal-2/common-configuration#listeners)

## Data

### Data source

The portlet data source configuration enables the portlet to execute specified queries towards the chosen database connector to fetch data, or fetch data from a workflow.

* Database: uses a flow connector to retrieve data from a database
* Workflow: runs a workflow to retrieve data

[Data source configuration](https://help.novacuraflow.com/development/flow-portal-2/common-configuration#database-source)

[Workflow source configuration](https://help.novacuraflow.com/development/flow-portal-2/common-configuration#workflow-source)

### Data source columns

Manage: the columns can be configured as a grid view as well as the list view. This view can help for a better overview and quicker configuration when a lot of columns are in use.

Value in Presentation must be filled in before data source columns can be configured.

Click *Execute* in the data source section to fetch the columns. Each column can be configured with:

* display name
* column type

There are a number of column types to choose from. The default column type is text.

* Text: use to display column as a text fields
* Number: use for number fields where the number is an integer
* Decimal: use for numbers with decimals
* Date: will display the column as a date with no time
* Date & Time: use to display date and time

### Presentation

Under *presentation,* add the data to be shown in the speedometer:

* Value: the needle pointer in the speedometer, also shown as a number below the graphics
* Unit: the unit of the value (not mandatory)
* Description: the description to describe the value (not mandatory)
* Min: the minimum value and start point of the speedometer scale - can be a variable or manual input
* Max: the maximum value and endpoint of the speedometer scale - can be a variable or manual input
* Step: the value between each scale marker - can be a variable or manual input

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M0c9ssc9xsbJxrKD0FW%2F-M0cAnzvL1-HNRrfWr0q%2Fimage.png?alt=media&#x26;token=5302ed24-03b4-48d0-9335-e63c38cc0d54" alt=""></div>

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M0c9ssc9xsbJxrKD0FW%2F-M0cAkYt8KYHbXQRiMSj%2Fimage.png?alt=media&#x26;token=cbf4b27c-062c-4f16-91d6-49db9361f4b6" alt=""></div>

## Speedometer color rules

The speedometer colors can all be configured. As a default, the pointer and scale colors are set to different shades of blue. Click on the color box to configure the pointer and scales colors.

* Range font color: enable to color the scale number values according to setup range color rules
* Pointer color: the color of the needle pointer
* Scale color: the primary color of the scale
* Second scale color: secondary scale color

The preview tab below shows a speedometer with default colors.

{% tabs %}
{% tab title="Set up speedometer color" %}

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M8pUMc6ICO1EjceitG2%2F-M8pW5l2WDF5CSyG-Rq0%2Fimage.png?alt=media&#x26;token=eeae3921-0a7b-4486-a69b-637ba38a27e3" alt=""></div>
{% endtab %}

{% tab title="Preview" %}

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M0bs-eMJvj9m0oULVBl%2F-M0c7sCI6fNXFfbByES-%2Fimage.png?alt=media&#x26;token=ece32818-6399-43e2-8d71-2419515d1a9a" alt=""></div>
{% endtab %}
{% endtabs %}

The speedometer can have one or more scale color rules. The color rules override the default scale colors.

To enter a new rule:&#x20;

* click *New*
* select a color
* enter a Start and  End value. Value can either be a fixed value or a variable from the drop-down
* preview the result or save

To edit an existing rule, click on the rule and it expands into edit mode.&#x20;

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M8pUMc6ICO1EjceitG2%2F-M8p_k5nRaqt_bCIM8Gh%2Fimage.png?alt=media&#x26;token=addc948e-402f-4773-92d8-cd816f6222e7" alt=""></div>

<div align="left"><img src="https://529897662-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LtPTgZOYmpJka4jqs1v%2F-M8pUMc6ICO1EjceitG2%2F-M8pa9dMT_fJrNiXfFeX%2Fimage.png?alt=media&#x26;token=df6af42c-8e8d-4886-8aa6-8084a351b7d4" alt="Speedometer with color rules and range font color"></div>

## Style‌

Change the header text color and add a header stripe by configuring style.

[Style configuration](https://help.novacuraflow.com/development/flow-portal-2/common-configuration#style)
