Statistic

Displays a numeric statistic on a page.

Numeric statistics can return data from scripts and APIs and display values with some amount of formatting options.

Display a statistic from an API

APIs should return a single value to display as a statistic. An example API could look something like this.

Get-Random -Min 100 -Max 1000

You can then select the API under the data source tab.

Each time the page is loaded, the API is called and the random value is shown.

Display a statistic from a Script

Statistics shown from scripts will display the value return by the last job run for the script. Loading the page will not run the script again.

We will use this script as an example.

Get-Random -Min 100 -Max 1000

Select the script on the data source tab.

The statistic will be shown on the page based on the output of the script. You'll notice that refreshing the page does not change the value of the statistic unless the job is run again.

Customizing the Statistic

You can customize features such as the prefix, suffix, precision and whether to auto-reload the statistic on an interval.

Properties

Last updated

Copyright 2024 Ironman Software