Skip to main content
Version: 2027.02 Beta
View as Markdown

Perspective - Gauge

The default display for the Gauge component.

Component Palette Icon:

The Gauge component palette icon within the Perspective Components panel.

The Gauge component provides a way to show realtime values within configured ranges as they change. The needle gauge display works well for process variables, KPI dials, and operational readouts. It is fully customizable in its appearance, from colors, needle length, target markers, and more.

The Gauge component has three pre-configured variants:

  • Basic: Default gauge with a single value.
  • Threshold: Gauge with colored arc bands that encode operation zones.
  • Setpont: Gauge with a needle and multiple targets or setpoint markers.

Properties​

Most Properties have binding options. For more information on Bindings, see Types of Bindings in Perspective. This section only documents the Props Category of properties. The other Categories are described on the Perspective Component Properties page.

NameDescriptionProperty Type
dataThe process value and optional setpoint.
  • value: Numeric value for the gauge needle to display. Value is numeric.
  • target: An optional setpoint, or numerous setpoints when using the Setpoint variant, to pass a number for a single target or array of targets. The appearance of this setpoint is determined by the top-level target property. Note that when using the Setpoint variant, each target will have an additional color property that overrides this setting. If the data.target.color field isn't set, the top-level target styling is used. An empty or null value hides the target for all variants. Value is numeric.
array
rangeNumeric span of the gauge arc. Configurations include:
  • min: The minimum value of the gauge. Value is numeric.
  • max: The maximum value of the gauge. Value is numeric.
  • startAngle: Start angle of the arc in degrees. Measured clockwise from the 3 o'clock position. Default is 225. Value is numeric.
  • endAngle: End angle of the arc in degrees. Default is -45, which sets the gauge sweep at a conventional 270 degree arc. Value is numeric.
array
bandsArc color zones. Configuration options include:
  • mode: Determines how band colors appear. If axis mode is selected, colors are applied directly on the arc segments. If progress mode is selected, the base arc color is neutral, and the fill color is driven by the range of the current value. Value is string.
  • ranges: Ordered list of colored value ranges on the arc. Each entry defines a band in engineering units. Options are present by default for the Threshold variant, but can be added to any variant. Options include:
    • min: Lower bound of the band. Should align with the range.min for the first band, and band.ranges.max for all subsequent bands. Value is numeric.
    • max: The upper bound of the band. Should align with range.max for the last band. Value is numeric.
    • color: Arc color of the band.
array
needleNeedle appearance configuration.
  • visible: Shows or hides the needle. Default is true. Value is boolean.
  • length: Sets the needle length. The number is treated as a proportion of the gauge radius, so 0.8 will be read as 80%. A string is treated as is. Default value is 100%, which reaches the arc. Value is string.
  • width: Needle width in pixels at the base. Value is string.
  • color: Color of the needle. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector. If left empty, the needle color will use the active arc color.
  • offsetX: Horizontal offset of the needle pivot from the gauge center. Can be entered as pixels or percentage of the gauge radius. Value is string.
  • offsetY: Vertical offset of the needle pivot from the gauge center. Can be entered as pixels or percentage of the gauge radius. Positive values move down. Value is string.
  • shape: Determines the needle shape. Built-in shape selections include needle, circle, pin, speedometer, clock, and triangle. However, a named present or custom SVG path string can be used when prefixed with path://. Value is string.
  • anchor: Center anchor/hub where the needle pivots. See anchor properties for more details.
  • elementStyle: Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.
array
targetTarget (setpoint) marker appearance configuration. Only visible when data.target is set.
  • visible: Shows or hides the target marker. Default is true. Value is boolean.
  • length: Sets the target tick mark length. The number is treated as a proportion of the gauge radius, so 0.15 will be read as 15%. A string is treated as is. Default value is 10%. Value is string.
  • width: Sets the target tick mark width in pixels. Recommended to use a value wider than the needle so that it will always be visible. Value is string.
  • color: Color of the target tick mark. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.
  • offsetX: Horizontal offset of the target tick mark pivot from the gauge center. Can be entered as pixels or percentage of the gauge radius. Value is string.
  • offsetY: Vertical offset of the target tick mark pivot from the gauge center. Can be entered as pixels or percentage of the gauge radius. Positive values move down. Value is string.
  • shape: Determines the needle shape. Built-in shape selections include needle, circle, pin, speedometer, clock, and triangle. However, a named present or custom SVG path string can be used when prefixed with path://. Value is string.
  • elementStyle: Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.
object
progressFills the arc from the start angle to the current value when bands.mode is set to progress. Configuration options include:
  • show: Shows or hides the progress arc. Will be disabled by default when axis bands encode the value range. Value is boolean.
  • roundCap: Progress caps will be rounded when true, and square when false. Value is boolean.
  • color: The fill color of the progress arc. Note that this color is independent of the needle color, and any color set under bands.mode.ranges.x.color will override this setting. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.
  • elementStyle: Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.
object
ticksTick marks on the gauge arc, and their numeric annotations determined by the ticks.labels configuration.
  • visible: Shows or hides the tick marks. Default is true. Value is boolean.
  • majorSplit: Number of major tick intervals on the arc. Value is numeric.
  • minorSplit: Number of minor tick marks between each pair of major ticks. Set to 0 to hide minor ticks. Value is numeric.
  • offset: Distance in pixels between the arc edge and the tick marks. Value is numeric.
  • color: The fill color of the tick marks. This value takes precedence over elementStyle.color when both are set. Defaults to the arc background color. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.
  • roundCap: Tick mark caps will be rounded when true, and square when false. Value is boolean.
  • labels: Numeric labels at each major tick position around the arc. Value is numeric.
  • elementStyle: Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.
object
labelsText labels displayed inside the gauge face.
  • value: Numeric value label shown inside the gauge. Value is numeric.
  • name: The name label shown below the value inside the gauge. Value is string.
See the value Properties and name Properties tables for more details.
object
titleThe chart title and subtitle text, styling, and layout configurations.
  • visible: Shows the title text when true. Value is boolean.
  • text: Main title text. Value is string.
  • color: The color of the title text. Overrides elementStyle.color when both are set.
  • fontSize: The font size of the legend item labels. Value is numeric.
  • subtitle: Configures the subtitle under the title, including text, color, size, and style.
  • position: Determines the legend placement. Value is string.
  • gap: Pixel gap between the main title and subtitle. Value is numeric.
  • elementStyle: Text style for a label rendered onto a chart canvas, including typography, alignment, box styling, and shadow.
object
appearanceArc thickness, positioning, animation, and background styling.
  • arcWidth: Width of the gauge arc in pixels. Value is numeric.
  • arcBackground: Color of the unfilled arc track. Used as the full arc color if bands.mode is progress.
  • radius: Gauge radius as a percentage of the component container or absolute pixels. Value is string.
  • centerX: Horizontal center position as a percentage of the container. Value is string.
  • centerY: Vertical center position as a percentage of the container. Value is string.
  • backgroundColor: Component background fill.
  • animation: Enables smooth progress/pointer animation when value updates. Value is boolean.
  • animationDuration: Duration in milliseconds of both the intial render animation and the value update sweep that fires when data.value changes. Value is numeric.
object
styleSets a style for this gauge. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.object

needle.anchor Properties​

NameDescriptionProperty Type
visibleShows or hides the anchor.boolean
showAboveRenders the anchor on top of the needle when true. Default is false.boolean
sizeDiameter of the anchor in pixels.numeric
colorThe fill color of the anchor. This value takes precedence over elementStyle.color when both are set. Defaults to the arc background color. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.color
shapeSets the anchor shape. Built-in shape selections include needle, circle, pin, speedometer, clock, and triangle. However, a named present or custom SVG path string can be used when prefixed with path://.string
offsetXHorizontal offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
offsetYVertical offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
elementStyleVisual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.object

labels.value Properties​

NameDescriptionProperty Type
visibleShows or hides the numeric value label.boolean
formatSets the label text template using a {value} token that dyanmically fills with the data.value property. A dropdown is available with default options, but custom options are allowed. Note that any other token or text entered is rendered as written.string
colorThe fill color of the tick marks. This value takes precedence over elementStyle.color when both are set. Defaults to the arc background color. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.color
offsetXHorizontal offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
offsetYVertical offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
elementStyleVisual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.object

labels.name Properties​

NameDescriptionProperty Type
visibleShows or hides the gauge's name label.boolean
textText for the label name, which will be shown below the value. Useful for labeling the process variable.string
colorThe fill color of the tick marks. This value takes precedence over elementStyle.color when both are set. Defaults to the arc background color. Can be chosen from color wheel, chosen from color palette, or entered as RGB or HSL value. See Color Selector.color
offsetXHorizontal offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
offsetYVertical offset of the anchor from the gauge center. Value can be in pixels or percentage of the gauge radius. Leave unset to keep the anchor at the gauge center.string
elementStyleVisual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration.object

Component Scripts and Events​

Further component interaction and functionality can be configured for all components through scripting and event actions. Right-click on the component or select Components from the Designer menubar to access the configuration popups for both of these options:

  • Configure Events: Accesses the Event Configuration popup where you can configure actions to run in response to events to make the component dynamic. The Events Configurations page shows how to configure events and actions on a Perspective component.

  • Configure Scripts: Accesses the Script Configuration popup where custom methods and message handlers can be added. The Scripting in Perspective section details scripting fundamentals, creating custom methods, and using message handlers.

The Gauge component also has Component Events associated with it. See the Perspective - Gauge Scripting page for more information.

Examples​

Basic Gauge - Target Marker Example​

A basic variant of a Gauge component with a blue target marker with a clock shape displayed at 85 percent.

This example shows how a configured target value and marker appear on a Gauge component. The sample data used in this example is listed below in JSON format.

Basic Gauge Chart Sample Data
{
"data": {
"value": 50,
"target": 85
},
"target": {
"length": "20%",
"color": "#81C8D4",
"offsetY": "-72%",
"shape": "clock"
},
"labels": {
"value": {
"format": "{value}%"
}
}
}

Threshold Gauge Example​

A threshold variant of a Gauge component, showing changing values reflected with yellow, orange, and red band colors.

This example displays how the Gauge chart appears when the bands.mode set to progress and the progress property set to true changes the band color as the value changes band ranges.

Changing the default values to the sample data listed below in JSON format allows you to then test how changing the data.value property to different numbers between the configured min/max ranges adjusts the band color to match. Since we didn't set a needle color override, the needle color will change as well.

Threshold Gauge Chart Sample Data
{
"bands": {
"mode": "progress",
"ranges": {
"0": {
"min": "0",
"max": "30",
"color": "#F3D61A"
},
"1": {
"min": "30",
"max": "70",
"color": "#E89C3F"
},
"2": {
"min": "70",
"max": "100",
"color": "#E71F3B"
}
}
},
"progress": {
"show": "true",
},
"ticks": {
"labels": {
color: "#000000",
}
}
}