Skip to main content

Gauge

Ant Design

The Gauge component shows one value on a dial against a scale, such as progress toward a target or a utilization score.

Properties​

Property
Description
Expected Value
TargetThe value the needle points to. The needle stops at the ends of the scale, but the number in the middle shows the real value.Number. Default: 72
TotalThe value at the end of the scale.Number. Default: 100
NameA name for the value the gauge shows.Text
ThresholdsWhere the color bands end, such as [40, 70, 100] for red, amber and green bands. Leave it empty for a single band in the theme color.Array
FormatterHow the number in the middle is written. percent shows Target as a share of Total; compact shortens large numbers, such as 1.2K.auto, number, currency, percent, compact. Default: auto
CurrencyCurrency code, such as USD or EUR, used when Formatter is currency.Text. Default: USD
LocaleLocale for number and currency formats, such as pt-BR. Leave it empty to follow the currency's usual format.Text
TitleHeading shown above the gauge.Text

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Set visibilityShows the component when true, hides it when false.components.gauge1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.gauge1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.gauge1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
targetThe value the needle points to. The needle stops at the ends of the scale, but the number in the middle shows the real value.{{components.gauge1.target}}
totalThe value at the end of the scale.{{components.gauge1.total}}
nameA name for the value the gauge shows.{{components.gauge1.name}}
thresholdsWhere the color bands end, such as [40, 70, 100] for red, amber and green bands. Leave it empty for a single band in the theme color.{{components.gauge1.thresholds}}
formatterHow the number in the middle is written. percent shows Target as a share of Total; compact shortens large numbers, such as 1.2K.{{components.gauge1.formatter}}
currencyCurrency code, such as USD or EUR, used when Formatter is currency.{{components.gauge1.currency}}
localeLocale for number and currency formats, such as pt-BR. Leave it empty to follow the currency's usual format.{{components.gauge1.locale}}
titleHeading shown above the gauge.{{components.gauge1.title}}
isVisibleWhether the component is visible.{{components.gauge1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.gauge1.isLoading}}
isDisabledWhether the component is disabled.{{components.gauge1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.