Gauge Component

Gauge

Function: a!gaugeField()

Displays a completion percentage in a circular style similar to the Progress Bar. Best used for showing progress when there is a target value, such as the number of completed surveys out of 360 total surveys, or number of hired employees out of 20 total open positions.

See also: Gauge Icon, Gauge Percentage, Gauge Fraction

Parameters

Name Keyword Types Description

Label

label

Text

Text to display as the field label.

Label Position

labelPosition

Text

Determines where the label appears. Valid values:

  • "ABOVE" (default) Displays the label above the component.
  • "ADJACENT" Displays the label to the left of the component.
  • "COLLAPSED" Hides the label. The label will still be read by screen readers; see accessibility considerations for more information.
  • "JUSTIFIED" Aligns the label alongside the component starting at the edge of the page.

Instructions

instructions

Text

Supplemental text about this field.

Help Tooltip

helpTooltip

Text

Displays a help icon with the specified text as a tooltip. The tooltip displays a maximum of 500 characters. The help icon does not show when the label position is "COLLAPSED".

Percentage

percentage

Number (Decimal)

Number to display between 0 and 100.

Primary Text

primaryText

Text

Optional text to display on the first line inside the gauge. Create using plain text, a!gaugeIcon(), a!gaugePercentage(), or a!gaugeFraction().

Secondary Text

secondaryText

Text

Optional text to display on the second line inside the gauge.

Color

color

Text

Determines the color. Access the percentage using fv!percentage. Valid values: Any valid hex color or "ACCENT" (default), "POSITIVE", "NEGATIVE", "WARN".

Size

size

Text

Determines the size of the gauge. Valid values: SMALL, MEDIUM (default), LARGE.

Align

align

Text

Determines alignment of the gauge. Valid values: START, CENTER (default), END.

Accessibility Text

accessibilityText

Text

Additional text to be announced by screen readers. Used only for accessibility; produces no visible change.

Visibility

showWhen

Boolean

Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Tooltip

tooltip

Text

Text to display as a tooltip on the gauge.

Editing the gauge primary text

The gauge configuration pane contains a step-by-step designer to help you quickly try out all Primary Text formats. We recommend you use this designer to select the format that works best for your gauge.

gif of editing the value in the middle of the gauge using design mode

Notes

  • If the Percentage value is negative or null, the guage shows with 0% of the circle complete.
  • If the Percentage value is greater than 100, the gauge shows with 100% of the circle complete.
  • If custom primaryText or secondaryText does not fit within the gauge, it is truncated.
  • If the primaryText is formatted using a!gaugeIcon(), a!gaugePercentage(), or a!gaugeFraction(), it will resize to fit within the circle.
  • To conditionally set the color of the gauge, use fv!percentage as shown in the "Gauge Setting Color Based on Percentage" example below.

Examples

Copy and paste an example into the INTERFACE DEFINITION in EXPRESSION MODE to see it displayed.

Gauge Showing Fraction Complete

1
2
3
4
5
=a!gaugeField(
  label: "Evaluations Completed",
  percentage: (25 / 26) * 100,
  primaryText: a!gaugeFraction(denominator: 26)
)

Displays the following:

screenshot of a blue gauge showing 25/26 evaluations completed

Gauge showing percent complete

1
2
3
4
5
a!gaugeField(
  label: "Evaluations Completed",
  percentage: (25 / 26) * 100,
  primaryText: a!gaugePercentage()
)

Displays the following:

screenshot of a blue gauge showing 96% of evaluations completed

Gauge showing icon with secondary text

1
2
3
4
5
6
a!gaugeField(
  label: "Evaluations Completed",
  percentage: (25 / 26) * 100,
  primaryText: a!gaugeIcon(icon: "PENCIL"),
  secondaryText: "25 of 26"
)

Displays the following:

screenshot of a blue gauge with a pencil icon and showing 25/26 evaluations completed

Gauge setting color based on percentage

1
2
3
4
5
6
a!gaugeField(
  label: "Evaluations Completed",
  percentage: (25 / 26) * 100,
  primaryText: a!gaugepercentage(),
  color: if(fv!percentage > 50, "POSITIVE", "NEGATIVE")
  )

Displays the following:

screenshot of a green gauge showing 96% of evaluations completed

The following patterns include usage of the Gauge Component.

Open in Github Built: Thu, Feb 23, 2023 (02:59:22 PM)

On This Page

FEEDBACK