BarGauge

A circular bar widget.

Included in: dx.chartjs.js, dx.all.js

The dxBarGauge widget represents data as a set of bars. Each bar resides on a separate circular track and indicates one value. That bar is accompanied by a label displaying the indicated value.

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxBarGauge jQuery plug-in.

    HTML
    <div id="gaugeContainer"></div>
    JavaScript
    $("#gaugeContainer").dxBarGauge({
        startValue: 0,
        endValue: 100,
        values: [21.3, 54.1, 30.9, 45.2, 89.41]
    });
  • Knockout
    Add a div element and apply the dxBarGauge binding to this element.

    HTML
    <div data-bind="dxBarGauge: {
        startValue: 0,
        endValue: 100,
        values: [21.3, 54.1, 30.9, 45.2, 89.41]
    }"></div>
  • Angular
    Add a div element and apply the dx-bar-gauge directive to this element.

    HTML
    <div dx-bar-gauge="{
        startValue: 0,
        endValue: 100,
        values: [21.3, 54.1, 30.9, 45.2, 89.41]
    }"></div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular library is also required.

See Also

View Demo Watch Video

See Also

To learn about widget concepts and overview features, refer to the Gauges section within the Data Visualization Guides.

Configuration

An object that defines configuration options for the dxBarGauge 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.

endValue

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

geometry

Defines the shape of the gauge's arc.

label

Specifies the options of the labels that accompany gauge bars.

loadingIndicator

Specifies the appearance of the loading indicator.

onDisposing

A handler for the disposing event.

onDrawn

A handler for the drawn event.

onIncidentOccurred

A handler for the incidentOccurred event.

onInitialized

A handler for the initialized event.

onOptionChanged

A handler for the optionChanged event.

onTooltipHidden

A handler for the tooltipHidden event.

onTooltipShown

A handler for the tooltipShown event.

palette

Sets the name of the palette or an array of colors to be used for coloring the gauge range container.

pathModified

Notifies a widget that it is embedded into an HTML page that uses a path modifier.

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.

rtlEnabled

Specifies whether or not the widget supports right-to-left representation.

size

Specifies the size of the widget in pixels.

startValue

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

subtitle

Specifies a subtitle for a gauge.

theme

Sets the name of the theme to be used in the widget.

title

Specifies a title for a gauge.

tooltip

Specifies options for gauge tooltips.

values

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

Methods

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

Name Description
beginUpdate()

Prevents the component from refreshing until the endUpdate method is called.

element()

Returns the root HTML element of the widget.

endUpdate()

Enables the component to refresh after the beginUpdate method call.

hideLoadingIndicator()

Conceals the loading indicator.

instance()

Returns an instance of this component class.

off(eventName)

Detaches all event handlers from the specified event.

off(eventName, eventHandler)

Detaches a particular event handler from the specified event.

on(eventName, eventHandler)

Subscribes to a specified event.

on(events)

Subscribes to the specified events.

option()

Returns the configuration options of this component.

option(optionName)

Gets the value of the specified configuration option of this component.

option(optionName, optionValue)

Sets a value to the specified configuration option of this component.

option(options)

Sets one or more options of this component.

render()

Redraws the widget.

showLoadingIndicator()

Displays the loading indicator.

svg()

Returns the widget's SVG markup.

values()

Returns an array of gauge values.

values(newValues)

Updates the values displayed by a gauge.

Events

This section describes events exposed by this widget.

Name Description
disposing

Fires when the widget is being removed.

drawn

Fires when the widget has finished drawing itself.

incidentOccurred

Fires when an error or warning appears in a widget.

initialized

Fires when the widget is initialized.

optionChanged

Fires after an option of the component is changed.

tooltipHidden

Fires when a bar's tooltip becomes hidden.

tooltipShown

Fires when a bar's tooltip appears.