Statistic
A content box to display numeric stats and trends. It supports currencies and percentages, primary and secondary values, icons and captions, and trend signs and colors.
Statistic uses negative values to display downward trend information.
Properties
Available properties for Statistic with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read information about components.
The current value.
The horizontal alignment of the contents.
Whether the component has an enabled Click event handler.
The three-letter ISO currency code to use if format
is currency
.
The number of decimal places to display. If necessary, values round up or down automatically.
Whether to display the primary value with a positive or negative trend color.
The formatting style to use for the primary value.
Whether the component is visible.
The icon to display.
The text to display as a label for the input field.
The additional text to display with the label.
Whether the component takes up space on the canvas if hidden
is true
.
The amount of margin to render outside of the component.
Whether to include trailing zeros to match the specified number for decimalPlaces
.
Whether the primary value should be considered a positive trend.
The text to display before the primary content.
The three-letter ISO currency code to use if secondaryFormattingStyle
is currency
.
The maximum number of digits after the decimal in the secondary value.
Whether to display the secondary value with a positive or negative trend color.
The formatting style to use for the secondary value.
Whether to include trailing zeros in the secondary value to match the specified number of secondaryDecimalPlaces
.
Whether the secondary value should be considered a positive trend.
Text to display before the secondary value.
Whether the secondary value includes a localized thousands separator.
Whether to display only the negative sign (auto
), positive and negative (exceptZero
), or arrows (trendArrows
) with the secondary value.
The text to display after the secondary value.
The secondary value.
Whether the component remains visible in the editor if hidden
is true
.
Whether the formatted value includes a localized thousands separator.
Whether to display only the negative sign (auto
), positive and negative (exceptZero
), or arrows (trendArrows
).
The text to display after the primary value.
The text to display in a tooltip on hover or focus.
Events
Events are triggered by user interactions with Statistic. Use event handling to trigger queries or other actions in response to events.
A user clicks the component.
Methods
Methods for interacting with Statistic. You can write JavaScript almost anywhere in Retool and use methods to manipulate data or components.
Set the current value.
Clear the current value.
Scrolls the canvas or parent container so that the selected component appears in the visible area.
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
Reset value
to the default value.