Stats Number
The "Stats Number" component is similar to the Stats component; it uses a graph-style icon to display your "statistical data". However, the difference is, the Stats Number allows you to input the values directly, which are then automatically calculated, and the corresponding differential percentage is displayed with the appropriate up/down icon.
Stats Number | Settings |
---|---|
Note: Auto-calculates the percentage! From the given Current and Previous Values. |
Properties
Property | Description |
---|---|
Title | This text will be set as the title for the component. |
Current Value | Sets the current value; will be used for calculating the differentials. |
Previous Value | Sets the previous value; will be used for calculating the differentials. |
Width | Adjusts the width of the widget. |
Icon | Select from the available icon choices. |
Description | Enter the "description" that provides additional information about the data. |
Percentage Indicater (Checkbox) | Enables the "Icon" option, which displays the differential percentage. (Note: If unchecked, the "Previous Value" field is disabled.) |
API Methods
setCurrentValue
Sets the current value for the component.
- Method
- Usage
setCurrentValue(value: number): void
// Sets the current value as "200"
a8forms.StatsNumber("statsNumberId").setCurrentValue(200)
setPreviousValue
Sets the previous value for the component.
- Method
- Usage
setPreviousValue(value: number): void
// Sets the previous value as "100"
a8forms.StatsNumber("statsNumberId").setPreviousValue(100)
setVisibility
Sets the Visibility flag for this component.
- Method
- Usage
setVisibility(visible: boolean): void
// Setting the visibility to "true" makes the element visible
a8forms.StatsNumber("statsNumberId").setVisibility(true)
// Setting the visibility to "false" makes the element invisible
a8forms.StatsNumber("statsNumberId").setVisibility(false)
setVisibilityCondition
Sets the visibility condition for this component.
- Method
- Usage
setVisibilityCondition(condition: string): void
// Sets a condition for changing the element's visibility status.
a8forms.StatsNumber("statsNumberId").setVisibilityCondition("1 === 1");