Statistic
Displays a numeric statistic on a page.
Last updated
Displays a numeric statistic on a page.
Last updated
Copyright 2024 Ironman Software
Numeric statistics can return data from scripts and APIs and display values with some amount of formatting options.
APIs should return a single value to display as a statistic. An example API could look something like this.
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.
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.
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.
You can customize features such as the prefix, suffix, precision and whether to auto-reload the statistic on an interval.
Property | Description | Available Since |
ID | The ID of this component | 2.2.0 |
Title | The text to display within the statistic. | 2.2.0 |
Data Source | The script or API to call to return the statistic's value. | 2.2.0 |
Prefix | The string to display before the value. | 2.2.0 |
Suffix | The string to display after the value. | 2.2.0 |
Auto Reload | Whether to auto-reload the statistic on an interval. | 2.2.0 |
Auto Reload Interval | The number of seconds between auto-reloads. | 2.2.0 |
Precision | The number of decimal places to display in the value. | 2.2.0 |