Usage
Signature:
interface CMeterBarElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CMeterBarElement } from "oj-c/meter-bar";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/meter-bar";
For additional information visit:
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.
Attributes
-
color :string
-
Specifies the color of the meter bar indicator. Only applies when thresholdDisplay is not set to indicator.
Names
Item Name Property colorProperty change event colorChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-color-changed -
datatip :(context: oj-c.MeterBar.DatatipContext) => string | null
-
The function that returns a custom datatip string for given value of meter bar. The function is called with DatatipContext as context. If datatip is undefined, meter bar will use the default datatip. If the returned value of the function is null, no datatip is shown.
Names
Item Name Property datatipProperty change event datatipChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-datatip-changed -
described-by :(string|null)
-
Used to establish a relationship between this component and another element. To facilitate correct screen reader behavior, the described-by attribute is copied to the aria-describedby attribute on the component's dom.
Names
Item Name Property describedByProperty change event describedByChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-described-by-changed -
indicator-size :number
-
Specifies the ratio of relative thickness of the indicator to the plot area.
- Default Value:
1
Names
Item Name Property indicatorSizeProperty change event indicatorSizeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-indicator-size-changed -
labelled-by :(string|null)
-
Used to establish a relationship between this component and another element. A common use is to tie a label, which a text in a div or some other HTML element, and the oj-c-meter-bar together for accessibility. The label element has an id, which is used by the labelled-by attribute to tie the two components together to facilitate correct screen reader behavior.
Names
Item Name Property labelledByProperty change event labelledByChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-labelled-by-changed -
max :number
-
Integer value specifying the maximum value of the meter bar.
- Default Value:
100
Names
Item Name Property maxProperty change event maxChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-max-changed -
min :number
-
Integer value specifying the minimum value of the meter bar.
- Default Value:
0
Names
Item Name Property minProperty change event minChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-min-changed -
orientation :"horizontal"|"vertical"
-
Specifies the orientation of the meter bar to render.
- Default Value:
"horizontal"
Names
Item Name Property orientationProperty change event orientationChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-orientation-changed -
plot-area :oj-c.MeterBar.PlotArea
-
Specifies the plot area of the meter bar.
Names
Item Name Property plotAreaProperty change event plotAreaChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-plot-area-changed -
readonly :boolean
-
Defines whether the value of the meter bar can be changed by the end user.
- Default Value:
false
Names
Item Name Property readonlyProperty change event readonlyChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-readonly-changed -
reference-lines :Array.<oj-c.MeterBar.ReferenceLine>
-
Specifies the array of objects defining the reference lines for the meter bar.
Names
Item Name Property referenceLinesProperty change event referenceLinesChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-reference-lines-changed -
size :"sm"|"md"|"lg"
-
Specifies the size of the meter bar.
- Default Value:
"md"
Supported Values:
Value Description lglarge Meter Bar mdmedium Meter Bar (default, if unspecified) smsmall Meter Bar Names
Item Name Property sizeProperty change event sizeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-size-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:
1
Names
Item Name Property stepProperty change event stepChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-step-changed -
threshold-display :"all"|"plotArea"|"indicator"
-
Controls whether the current threshold is displayed on the indicator, in the plot area, or if all the thresholds are displayed in the plot area.
- Default Value:
"indicator"
Names
Item Name Property thresholdDisplayProperty change event thresholdDisplayChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-threshold-display-changed -
thresholds :Array.<oj-c.MeterBar.Threshold>
-
An array of objects defining the thresholds for the meter bar.
Names
Item Name Property thresholdsProperty change event thresholdsChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-thresholds-changed -
(readonly) transient-value :number
-
A read-only property for retrieving the transient value from the meter bar. It is triggered when dragging over the meter bar.
- Supports writeback:
true
Names
Item Name Property transientValueProperty change event transientValueChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-transient-value-changed -
value :(number|null)
-
The value of the meter bar.
- Default Value:
0
- Supports writeback:
true
Names
Item Name Property valueProperty change event valueChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-value-changed
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description propertyThe property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesAn object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description propertyThe property name to set. Supports dot notation for subproperty access. valueThe new value to set the property to. Returns:
- Type
- void
Type Definitions
-
DatatipContext
-
Context for datatip function.
Properties:
Name Type Description valuenumber The current value of the meter bar. -
PlotArea
-
Properties:
Name Type Argument Description colorstring <optional>
The color of the plot area. rendered"off" | "on" <optional>
Defines if the plot area is to be rendered. The default value is on. -
ReferenceLine
-
Properties:
Name Type Argument Description colorstring <optional>
The color of the reference line.
In addition to standard CSS color values, special enumerated values 'danger', 'warning', and 'success' are also supported. These special values are mapped to corresponding CSS color values based upon the current theme.
position"end" | "start" <optional>
The position of the reference line. valuenumber The value of the reference line. -
Threshold
-
Properties:
Name Type Argument Description accessibleLabelstring <optional>
A label for the threshold used for accessibility purposes. colorstring <optional>
The color of the threshold.
In addition to standard CSS color values, special enumerated values 'danger', 'warning', and 'success' are also supported. These special values are mapped to corresponding CSS color values based upon the current theme.
maxnumber The maximum value of the threshold.