Perspective - Gauge

Component Palette Icon:
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.
| Name | Description | Property Type |
|---|---|---|
| data | The process value and optional setpoint.
| array |
| range | Numeric span of the gauge arc. Configurations include:
| array |
| bands | Arc color zones. Configuration options include:
| array |
| needle | Needle appearance configuration.
| array |
| target | Target (setpoint) marker appearance configuration. Only visible when data.target is set.
| object |
| progress | Fills the arc from the start angle to the current value when bands.mode is set to progress. Configuration options include:
| object |
| ticks | Tick marks on the gauge arc, and their numeric annotations determined by the ticks.labels configuration.
| object |
| labels | Text labels displayed inside the gauge face.
| object |
| title | The chart title and subtitle text, styling, and layout configurations.
| object |
| appearance | Arc thickness, positioning, animation, and background styling.
| object |
| style | Sets 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​
| Name | Description | Property Type |
|---|---|---|
| visible | Shows or hides the anchor. | boolean |
| showAbove | Renders the anchor on top of the needle when true. Default is false. | boolean |
| size | Diameter of the anchor in pixels. | numeric |
| color | The 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 |
| shape | Sets 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 |
| offsetX | Horizontal 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 |
| offsetY | Vertical 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 |
| elementStyle | Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration. | object |
labels.value Properties​
| Name | Description | Property Type |
|---|---|---|
| visible | Shows or hides the numeric value label. | boolean |
| format | Sets 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 |
| 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. | color |
| offsetX | Horizontal 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 |
| offsetY | Vertical 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 |
| elementStyle | Visual style for a shape element rendered onto a chart canvas, including fill, stroke, opacity, shadow, and decoration. | object |
labels.name Properties​
| Name | Description | Property Type |
|---|---|---|
| visible | Shows or hides the gauge's name label. | boolean |
| text | Text for the label name, which will be shown below the value. Useful for labeling the process variable. | string |
| 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. | color |
| offsetX | Horizontal 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 |
| offsetY | Vertical 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 |
| elementStyle | Visual 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​

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.
{
"data": {
"value": 50,
"target": 85
},
"target": {
"length": "20%",
"color": "#81C8D4",
"offsetY": "-72%",
"shape": "clock"
},
"labels": {
"value": {
"format": "{value}%"
}
}
}
Threshold Gauge Example​

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.
{
"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",
}
}
}