BarGauge

The BarGauge widget contains several circular bars that each indicates a single value.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/bar_gauge
Export: default
BarGauge interactive configuration
Copy Code
Copy to Codepen
import BarGauge from "devextreme/viz/bar_gauge";

new BarGauge(container, {
});

                    
Type:

Object

Configuration

An object that defines configuration options for the BarGauge widget.

Name Description
animation

Specifies animation options.

backgroundColor

Specifies a color for the remaining segment of the bar's track.

barSpacing

Specifies a distance between bars in pixels.

baseValue

Specifies a base value for bars.

disabled

Specifies whether the widget responds to the user interaction.

elementAttr

Specifies the attributes to be attached to the widget's root element.

endValue

Specifies an end value for the gauge's invisible scale.

export

Configures the exporting and printing features.

geometry

Defines the shape of the gauge's arc.

label

Specifies the options of the labels that accompany gauge bars.

legend

Configures the legend.

loadingIndicator

Configures the loading indicator.

margin

Generates space around the widget.

onDisposing

A function that is executed before the widget is disposed of.

onDrawn

A function that is executed when the widget's rendering has finished.

onExported

A function that is executed after the widget is exported.

onExporting

A function that is executed before the widget is exported.

onFileSaving

A function that is executed before a file with exported widget is saved to the user's local storage.

onIncidentOccurred

A function that is executed when an error or warning occurs.

onInitialized

A function used in JavaScript frameworks to save the widget instance.

onOptionChanged

A function that is executed after a widget option is changed.

onTooltipHidden

A function that is executed when a tooltip becomes hidden.

onTooltipShown

A function that is executed when a tooltip appears.

palette

Sets the palette to be used for colorizing bars in the gauge.

paletteExtensionMode

Specifies what to do with colors in the palette when their number is less than the number of bars in the gauge.

pathModified

Notifies the widget that it is embedded into an HTML page that uses a tag modifying the path.

redrawOnResize

Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates.

relativeInnerRadius

Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar.

resolveLabelOverlapping

Specifies how the widget should behave when bar labels overlap: hide certain labels or leave them overlapped.

rtlEnabled

Switches the widget to a right-to-left representation.

size

Specifies the widget's size in pixels.

startValue

Specifies a start value for the gauge's invisible scale.

theme

Sets the name of the theme the widget uses.

title

Configures the widget's title.

tooltip

Configures tooltips.

values

Specifies the array of values to be indicated on a bar gauge.

See Also

Methods

This section describes the methods that can be used in code to manipulate objects related to the BarGauge widget.

Name Description
beginUpdate()

Prevents the widget from refreshing until the endUpdate() method is called.

dispose()

Disposes of all the resources allocated to the BarGauge instance.

element()

Gets the root widget element.

endUpdate()

Refreshes the widget after a call of the beginUpdate() method.

exportTo(fileName, format)

Exports the widget.

getInstance(element)

Gets the instance of a widget found using its DOM node.

getSize()

Gets the current widget size.

hideLoadingIndicator()

Hides the loading indicator.

instance()

Gets the widget's instance. Use it to access other methods of the widget.

off(eventName)

Detaches all event handlers from a single event.

off(eventName, eventHandler)

Detaches a particular event handler from a single event.

on(eventName, eventHandler)

Subscribes to an event.

on(events)

Subscribes to events.

option()

Gets all widget options.

option(optionName)

Gets the value of a single option.

option(optionName, optionValue)

Updates the value of a single option.

option(options)

Updates the values of several options.

print()

Opens the browser's print window.

render()

Redraws the widget.

resetOption(optionName)

Resets an option to its default value.

showLoadingIndicator()

Shows the loading indicator.

svg()

Gets the widget's SVG markup.

values()

Gets all the values.

values(newValues)

Updates all the values.

See Also

Events

This section describes events fired by this widget.

Name Description
disposing

Raised before the widget is disposed of.

drawn

Raised when the widget's rendering has finished.

exported

Raised after the widget is exported.

exporting

Raised before the widget is exported.

fileSaving

Raised before a file with exported widget is saved to the user's local storage.

incidentOccurred

Raised when an error or warning occurs.

initialized

Raised only once, after the widget is initialized.

optionChanged

Raised after a widget option is changed.

tooltipHidden

Raised when a tooltip becomes hidden.

tooltipShown

Raised when a tooltip appears.

See Also