Element: <oj-status-meter-gauge>

Oracle® JavaScript Extension Toolkit (JET)
4.2.0

E91398-01

QuickNav

Attributes

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 4.2.0
Since:
  • 0.7

JET Custom Elements

JET components are implemented as custom HTML elements. A detailed description of working with these elements can be found in: JET Custom Element Usage.

JET Status Meter Gauge

Status meter gauges support horizontal and circular status meters.


<oj-status-meter-gauge
  value='63' 
  min='0' 
  max='100'
  thresholds='[{"max": 33}, {"max": 67}, {}]'>
</oj-status-meter-gauge>

Accessibility

The application is responsible for populating the shortDesc value in the component properties object with meaningful descriptors when the component does not provide a default descriptor. Since component terminology for keyboard and touch shortcuts can conflict with those of the application, it is the application's responsibility to provide these shortcuts, possibly via a help popup.

Touch End User Information

Gesture Action
Press & Hold Display tooltip.
Drag Value change when readonly is false.

Keyboard End User Information

Key Action
Enter Submit the current value of the gauge.
Tab Move focus to next element and submit the current value of the gauge.
Shift + Tab Move focus to previous element.
UpArrow Increase the gauge's transient value. Value is set after using Enter or Tab to submit.
DownArrow Decrease the gauge's transient value. Value is set after using Enter or Tab to submit.
LeftArrow Decrease the gauge's transient value in left-to-right locales. Increase the gauge's transient value in right-to-left locales. Value is set after using Enter or Tab to submit.
RightArrow Increase the gauge's transient value in left-to-right locales. Decrease the gauge's transient value in right-to-left locales. Value is set after using Enter or Tab to submit.

Performance

Tracking Resize

By default, the element will track resizes and render at the new size. This functionality adds a small overhead to the initial render for simple elements like gauges or spark charts, which become noticable when using large numbers of these simple elements. To disable resize tracking, set trackResize to off. The application can manually request a re-render at any time by calling the refresh function.

Reading direction

As with any JET component, in the unusual case that the directionality (LTR or RTL) changes post-init, the component must be refresh()ed.

Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.

Slots

JET elements can have up to two types of child content:

  • Any child element with a slot attribute will be moved into that named slot, e.g. <span slot='startIcon'>...</span>. All supported named slots are documented below. Child elements with unsupported named slots will be removed from the DOM.
  • Any child element lacking a slot attribute will be moved to the default slot, also known as a regular child.

contextMenu

The contextMenu slot is set on the oj-menu within this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.

The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.

To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc and demos of the individual components for details.

Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.

Example

Initialize the component with a context menu:

<oj-some-element>
    <-- use the contextMenu slot to designate this as the context menu for this component -->
    <oj-menu slot="contextMenu" style="display:none" aria-label="Some element's context menu">
...
    </oj-menu>
</oj-some-element>

Attributes

angle-extent :number

Specifies the angle extent of a gauge with circular orientation. Value should be provided in degrees.
Default Value:
  • 360
Names
Item Name
Property angleExtent
Property change event angleExtentChanged
Property change listener attribute (must be of type function) on-angle-extent-changed

animation-duration :number

The duration of the animations, in milliseconds.
Default Value:
  • null
Names
Item Name
Property animationDuration
Property change event animationDurationChanged
Property change listener attribute (must be of type function) on-animation-duration-changed

animation-on-data-change :string

Defines the animation that is applied on data changes.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDataChange
Property change event animationOnDataChangeChanged
Property change listener attribute (must be of type function) on-animation-on-data-change-changed

animation-on-display :string

Defines the animation that is shown on initial display.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "none"
Names
Item Name
Property animationOnDisplay
Property change event animationOnDisplayChanged
Property change listener attribute (must be of type function) on-animation-on-display-changed

border-color :string

The border color of the gauge. Only applies when thresholds are not defined.
Default Value:
  • null
Names
Item Name
Property borderColor
Property change event borderColorChanged
Property change listener attribute (must be of type function) on-border-color-changed

border-radius :string

Defines the border radius of the indicator and plot area. When set to "auto", the border radius is set to a built-in default. Acceptable input follows CSS border-radius attribute specifications. The plot area border radius can be overwritten with the plotArea borderRadius atribute.
Supported Values:
Name Type
"auto" string
Default Value:
  • "auto"
Names
Item Name
Property borderRadius
Property change event borderRadiusChanged
Property change listener attribute (must be of type function) on-border-radius-changed

center :object

An object defining the center content of a status meter with circular orientation.
Default Value:
  • {}
Names
Item Name
Property center
Property change event centerChanged
Property change listener attribute (must be of type function) on-center-changed

center.renderer :function(object)

A function that returns custom center content. The function takes a dataContext argument, provided by the gauge, with the following properties:
  • outerBounds: Object containing (x, y, width, height) of the rectangle circumscribing the center area. The outer bounds are useful for creating background for the entire center area when used with a CSS border-radius. If the angleExtent isn't 360 then we will provide the clipped square. The x and y coordinates are relative to the top, left corner of the element.
  • innerBounds: Object containing (x, y, width, height) of the rectangle inscribed in the center area. The inner bounds are useful for inserting content that is guaranteed to fit within the center area. If the angleExtent isn't 360 then we will provide the clipped square. The x and y coordinates are relative to the top, left corner of the element.
  • metricLabel: The computed metric label.
  • componentElement: The status meter gauge HTML element.
The function should return an Object with the following property:
  • insert: HTMLElement - HTML element, which will be overlaid on top of the gauge. This HTML element will block interactivity of the gauge by default, but the CSS pointer-events property can be set to 'none' on this element if the gauge's interactivity is desired.
Default Value:
  • null
Names
Item Name
Property center.renderer

color :string

The color of the gauge. Only applies when thresholds are not defined.
Default Value:
  • null
Names
Item Name
Property color
Property change event colorChanged
Property change listener attribute (must be of type function) on-color-changed

indicator-size :number

Defines the ratio of relative thickness of the indicator to the plot area.
Default Value:
  • 1
Names
Item Name
Property indicatorSize
Property change event indicatorSizeChanged
Property change listener attribute (must be of type function) on-indicator-size-changed

inner-radius :number

Specifies the inner radius of a gauge with circular orientation, defined by the distance from the center of the gauge to the innermost edge of the indicator and plot area. Valid values are a percent or ratio from 0 to 1.
Default Value:
  • .7
Names
Item Name
Property innerRadius
Property change event innerRadiusChanged
Property change listener attribute (must be of type function) on-inner-radius-changed

label :object

An object defining the label.
Default Value:
  • {}
Names
Item Name
Property label
Property change event labelChanged
Property change listener attribute (must be of type function) on-label-changed

label.position :string

Defines the position of the label for horizontal and vertical gauges. The default position for horizontal gauges is 'start' and for vertical gauges is 'center'.
Supported Values:
Name Type
"auto" string
"center" string
"start" string
Default Value:
  • "auto"
Names
Item Name
Property label.position

label.style :object

The CSS style object defining the style of the label.
Default Value:
  • {}
Names
Item Name
Property label.style

label.text :string

The text for the label.
Default Value:
  • null
Names
Item Name
Property label.text

max :number

The maximum value of the gauge.
Default Value:
  • 100
Names
Item Name
Property max
Property change event maxChanged
Property change listener attribute (must be of type function) on-max-changed

metric-label :object

An object defining the value label.
Default Value:
  • {}
Names
Item Name
Property metricLabel
Property change event metricLabelChanged
Property change listener attribute (must be of type function) on-metric-label-changed

metric-label.converter :object

The converter used to format the labels. When using a converter, scaling should be set to none, as the formatted result may not be compatible with the scaling suffixes.
Default Value:
  • null
Names
Item Name
Property metricLabel.converter

metric-label.position :string

Defines the position of the metric label for horizontal and vertical gauges. The default position of the metric label is outside of the plot area. If the label is not rendered, then 'withLabel' will render the metric label outside the plot area. When the label is rendered, all positions are treated as 'withLabel' except 'auto' and 'outsidePlotArea' which render the metric label outside the plot area. When the metric label is rendered 'withLabel', the metric label is displayed with the same style as the label. The position in the 'withLabel' case is specified by the label position attribute.
Supported Values:
Name Type
"auto" string
"center" string
"insideIndicatorEdge" string
"outsideIndicatorEdge" string
"outsidePlotArea" string
"withLabel" string
Default Value:
  • "auto"
Names
Item Name
Property metricLabel.position

metric-label.rendered :string

Defines if the label is rendered. If set to auto, the label is rendered if the orientation is circular.
Supported Values:
Name Type
"auto" string
"off" string
"on" string
Default Value:
  • "auto"
Names
Item Name
Property metricLabel.rendered

metric-label.scaling :string

The scaling behavior of the labels. When using a converter, scaling should be set to none, as the formatted result may not be compatible with the scaling suffixes.
Supported Values:
Name Type
"auto" string
"billion" string
"million" string
"none" string
"quadrillion" string
"thousand" string
"trillion" string
Default Value:
  • "auto"
Names
Item Name
Property metricLabel.scaling

metric-label.style :object

The CSS style object defining the style of the label.
Default Value:
  • {}
Names
Item Name
Property metricLabel.style

metric-label.text :string

The text for the label. If specified, text will overwrite the numeric value that is displayed by default. The converter, scaling, and textType attributes are ignored when text is specified.
Default Value:
  • null
Names
Item Name
Property metricLabel.text

metric-label.text-type :string

Defines whether the label is a number or a percentage of the total value.
Supported Values:
Name Type
"number" string
"percent" string
Default Value:
  • "number"
Names
Item Name
Property metricLabel.textType

min :number

The minimum value of the gauge.
Default Value:
  • 0
Names
Item Name
Property min
Property change event minChanged
Property change listener attribute (must be of type function) on-min-changed

orientation :string

Defines the type of status meter to be rendered.
Supported Values:
Name Type
"circular" string
"horizontal" string
"vertical" string
Default Value:
  • "horizontal"
Names
Item Name
Property orientation
Property change event orientationChanged
Property change listener attribute (must be of type function) on-orientation-changed

plot-area :object

Plot Area for Status Meter Guage
Default Value:
  • {}
Names
Item Name
Property plotArea
Property change event plotAreaChanged
Property change listener attribute (must be of type function) on-plot-area-changed

plot-area.border-color :string

The border color of the plot area.
Default Value:
  • null
Names
Item Name
Property plotArea.borderColor

plot-area.border-radius :string

Defines the border radius of the plot area shape. When set to "auto", the border radius is the same as the top level border radius. Acceptable input follows CSS border-radius attribute specifications.
Supported Values:
Name Type
"auto" string
Default Value:
  • "auto"
Names
Item Name
Property plotArea.borderRadius

plot-area.color :string

The color of the plot area. Only applies when useThresholdFillColor is off.
Default Value:
  • null
Names
Item Name
Property plotArea.color

plot-area.rendered :string

Defines if the plot area is to be rendered. If set to auto, the plot area is rendered if the orientation is circular or if the thresholdDisplay is not onIndicator.
Supported Values:
Name Type
"auto" string
"off" string
"on" string
Default Value:
  • "auto"
Names
Item Name
Property plotArea.rendered

plot-area.svg-class-name :string

The CSS style class to apply to the plot area. The style class and inline style will override any other styling specified through the properties.
Default Value:
  • ""
Names
Item Name
Property plotArea.svgClassName

plot-area.svg-style :object

The inline style to apply to the plot area. The style class and inline style will override any other styling specified through the properties.
Default Value:
  • {}
Names
Item Name
Property plotArea.svgStyle

readonly :boolean

Defines whether the value of the gauge can be changed by the end user.
Default Value:
  • false
Names
Item Name
Property readonly
Property change event readonlyChanged
Property change listener attribute (must be of type function) on-readonly-changed

reference-lines :Array.<object>

An array of objects with the following properties defining the reference lines for the gauge.
Default Value:
  • []
Names
Item Name
Property referenceLines
Property change event referenceLinesChanged
Property change listener attribute (must be of type function) on-reference-lines-changed

referenceLines[].color :string

The color of the reference line.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

referenceLines[].value :number

The value of the reference line.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

start-angle :number

Specifies the start angle of a gauge with circular orientation. Value should be provided in degrees.
Default Value:
  • 90
Names
Item Name
Property startAngle
Property change event startAngleChanged
Property change listener attribute (must be of type function) on-start-angle-changed

step :number

Specifies the increment by which values can be changed by the end user when readonly is false. The step must be a positive value that is smaller than the difference between the min and max.
Default Value:
  • null
Names
Item Name
Property step
Property change event stepChanged
Property change listener attribute (must be of type function) on-step-changed

svg-class-name :string

The CSS style class to apply to the gauge indicator. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the color attribute.
Default Value:
  • ""
Names
Item Name
Property svgClassName
Property change event svgClassNameChanged
Property change listener attribute (must be of type function) on-svg-class-name-changed

svg-style :object

The inline style to apply to the gauge indicator. The style class and inline style will override any other styling specified through the properties. For tooltip interactivity, it's recommended to also pass a representative color to the color attribute.
Default Value:
  • {}
Names
Item Name
Property svgStyle
Property change event svgStyleChanged
Property change listener attribute (must be of type function) on-svg-style-changed

threshold-display :string

Controls whether the current threshold is displayed on the indicator, in the plotArea, or if all the thresholds are diplayed in the plot area
Supported Values:
Name Type
"all" string
"currentOnly" string
"onIndicator" string
Default Value:
  • "onIndicator"
Names
Item Name
Property thresholdDisplay
Property change event thresholdDisplayChanged
Property change listener attribute (must be of type function) on-threshold-display-changed

thresholds :Array.<object>

An array of objects with the following properties defining the thresholds for the gauge.
Default Value:
  • []
Names
Item Name
Property thresholds
Property change event thresholdsChanged
Property change listener attribute (must be of type function) on-thresholds-changed

thresholds[].borderColor :string

The border color of the threshold.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

thresholds[].color :string

The color of the threshold.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

thresholds[].max :number

The upper bound of the threshold. This value is ignored for the final threshold, which uses the maximum value of the gauge.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

thresholds[].shortDesc :string

Specific description for the threshold and overwrites the shortDesc specified on gauge. This is used for accessibility and also for customizing the tooltip text.
Default Value:
  • null
Note: This property is a subproperty of an array-valued property. Such properties cannot be set individually either at init time via HTML attribute syntax or at runtime via JavaScript. Instead, the outermost array-valued attribute, and its ancestor attributes, can be set at init time or runtime.

tooltip :object

An object containing an optional callback function for tooltip customization.
Default Value:
  • {}
Names
Item Name
Property tooltip
Property change event tooltipChanged
Property change listener attribute (must be of type function) on-tooltip-changed

tooltip.renderer :function(object)

A function that returns a custom tooltip. The function takes a dataContext argument, provided by the gauge, with the following properties:
  • parentElement: The tooltip element. The function can directly modify or append content to this element.
  • label: The computed metric label.
  • color: The indicator color of the gauge.
  • componentElement: The status meter gauge HTML elment.
The function should return an Object that contains only one of the two properties:
  • insert: HTMLElement | string - An HTML element, which will be appended to the tooltip, or a tooltip string.
  • preventDefault: true - Indicates that the tooltip should not be displayed. It is not necessary to return {preventDefault:false} to display tooltip, since this is a default behavior.
Default Value:
  • null
Names
Item Name
Property tooltip.renderer

track-resize :string

Defines whether the element will automatically render in response to changes in size. If set to off, then the application is responsible for calling refresh to render the element at the new size.
Supported Values:
Name Type
"off" string
"on" string
Default Value:
  • "on"
Names
Item Name
Property trackResize
Property change event trackResizeChanged
Property change listener attribute (must be of type function) on-track-resize-changed
Examples

Initialize the data visualization element with the track-resize attribute specified:

<oj-some-dvt track-resize='off'></oj-some-dvt>

Get or set the trackResize property after initialization:

// getter
var value = myComponent.trackResize;

// setter
myComponent.trackResize="off";

<readonly> transient-value :number|undefined

PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

The transientValue is the read-only property for retrieving the transient value from the status meter gauge. It is triggered when dragging over the status meter gauge.

This is a read-only property so page authors cannot set or change it directly.

Supports writeback:
  • true
Since:
  • 4.2.0
Names
Item Name
Property transientValue
Property change event transientValueChanged
Property change listener attribute (must be of type function) on-transient-value-changed

translations :Object

A collection of translated resources from the translation bundle, or null if this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.

If this component has translations, their documentation immediately follows this doc entry.

Default Value:
  • an object containing all resources relevant to the component, or null if none
Names
Item Name
Property translations
Property change event translationsChanged
Property change listener attribute (must be of type function) on-translations-changed
Examples

Initialize the component, overriding some translated resources and leaving the others intact:

<!-- Using dot notation -->
<oj-some-element translations.some-key='some value' translations.some-other-key='some other value'></oj-some-element>

<!-- Using JSON notation -->
<oj-some-element translations='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-some-element>

Get or set the translations property after initialization:

// Get one
var value = myComponent.translations.someKey;

// Set one, leaving the others intact. Always use the setProperty API for 
// subproperties rather than setting a subproperty directly.
myComponent.setProperty('translations.someKey', 'some value');

// Get all
var values = myComponent.translations;

// Set all.  Must list every resource key, as those not listed are lost.
myComponent.translations = {
    someKey: 'some value',
    someOtherKey: 'some other value'
};

translations.component-name :string

Used to describe the data visualization type for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Gauge"
Names
Item Name
Property translations.componentName

translations.label-and-value :string

Used to display a label and its value.

See the translations attribute for usage examples.

Default Value:
  • "{0}: {1}"
Names
Item Name
Property translations.labelAndValue

translations.label-clear-selection :string

Text shown for clearing multiple selection on touch devices.

See the translations attribute for usage examples.

Default Value:
  • "Clear Selection"
Names
Item Name
Property translations.labelClearSelection

translations.label-count-with-total :string

Used to display a count out of a total.

See the translations attribute for usage examples.

Default Value:
  • "{0} of {1}"
Names
Item Name
Property translations.labelCountWithTotal

translations.label-data-visualization :string

Label for data visualizations used for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Data Visualization"
Names
Item Name
Property translations.labelDataVisualization

translations.label-invalid-data :string

Text shown when the component receives invalid data.

See the translations attribute for usage examples.

Default Value:
  • "Invalid data"
Names
Item Name
Property translations.labelInvalidData

translations.label-no-data :string

Text shown when the component receives no data.

See the translations attribute for usage examples.

Default Value:
  • "No data to display"
Names
Item Name
Property translations.labelNoData

translations.state-collapsed :string

Used to describe the collapsed state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Collapsed"
Names
Item Name
Property translations.stateCollapsed

translations.state-drillable :string

Used to describe a drillable object for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Drillable"
Names
Item Name
Property translations.stateDrillable

translations.state-expanded :string

Used to describe the expanded state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Expanded"
Names
Item Name
Property translations.stateExpanded

translations.state-hidden :string

Used to describe the hidden state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Hidden"
Names
Item Name
Property translations.stateHidden

translations.state-isolated :string

Used to describe the isolated state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Isolated"
Names
Item Name
Property translations.stateIsolated

translations.state-maximized :string

Used to describe the maximized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Maximized"
Names
Item Name
Property translations.stateMaximized

translations.state-minimized :string

Used to describe the minimized state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Minimized"
Names
Item Name
Property translations.stateMinimized

translations.state-selected :string

Used to describe the selected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Selected"
Names
Item Name
Property translations.stateSelected

translations.state-unselected :string

Used to describe the unselected state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Unselected"
Names
Item Name
Property translations.stateUnselected

translations.state-visible :string

Used to describe the visible state for accessibility.

See the translations attribute for usage examples.

Default Value:
  • "Visible"
Names
Item Name
Property translations.stateVisible

value :number

The metric value.
Default Value:
  • null
Supports writeback:
  • true
Names
Item Name
Property value
Property change event valueChanged
Property change listener attribute (must be of type function) on-value-changed

visual-effects :string

Defines whether visual effects such as overlays are applied to the gauge.
Supported Values:
Name Type
"auto" string
"none" string
Default Value:
  • "auto"
Names
Item Name
Property visualEffects
Property change event visualEffectsChanged
Property change listener attribute (must be of type function) on-visual-effects-changed

Methods

getMetricLabel() → {Object}

Returns the gauge's metric label.
Returns:
The metric label object
Type
Object

getProperty(property) → {*}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Returns:
Type
*
Example

Get a single subproperty of a complex property:

var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');

refresh()

Refreshes the component.

setProperties(properties)

Performs a batch set of properties.
Parameters:
Name Type Description
properties Object An object containing the property and value pairs to set.
Example

Set a batch of properties:

myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"});

setProperty(property, value)

Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value * The new value to set the property to.
Example

Set a single subproperty of a complex property:

myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue");