CircularGauge

The CircularGauge is a widget that indicates values on a circular numeric scale.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Export: default
CircularGauge interactive configuration
Copy Code
Copy to Codepen
$("#circulargauge").dxCircularGauge({
});

                    

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

jQuery
JavaScript
HTML
$(function () {
    $("#circularGauge").dxCircularGauge({
        scale: {
            startValue: 50,
            endValue: 150
        },    
        rangeContainer: {
            ranges: [
                { startValue: 50, endValue: 90 },
                { startValue: 90, endValue: 130 },
                { startValue: 130, endValue: 150 }
            ]
        },
        value: 105
    });
});
<div id="circularGauge"></div>
Angular
HTML
<dx-circular-gauge [value]="105">
    <dxo-scale
        [startValue]="50"
        [endValue]="150">
    </dxo-scale>
    <dxo-rangeContainer>
        <dxi-range 
            [startValue]="50"
            [endValue]="90">
        </dxi-range>
        <dxi-range 
            [startValue]="90"
            [endValue]="130">
        </dxi-range>
        <dxi-range 
            [startValue]="130"
            [endValue]="150">
        </dxi-range>
    </dxo-rangeContainer>
</dx-circular-gauge>
AngularJS
HTML
<div dx-circular-gauge="{
    scale: {
        startValue: 50,
        endValue: 150
    },    
    rangeContainer: {
        ranges: [
            { startValue: 50, endValue: 90 },
            { startValue: 90, endValue: 130 },
            { startValue: 130, endValue: 150 }
        ]
    },
    value: 105
}"></div>
Knockout
HTML
<div data-bind="dxCircularGauge: {
    scale: {
        startValue: 50,
        endValue: 150
    },    
    rangeContainer: {
        ranges: [
            { startValue: 50, endValue: 90 },
            { startValue: 90, endValue: 130 },
            { startValue: 130, endValue: 150 }
        ]
    },
    value: 105
}"></div>
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().CircularGauge()
    .ID("circularGauge")
    .Scale(scale => scale
        .StartValue(50)
        .EndValue(50)
    )
    .RangeContainer(rc => rc
        .Ranges(ranges => {
            ranges.Add().StartValue(50).EndValue(90);
            ranges.Add().StartValue(90).EndValue(130);
            ranges.Add().StartValue(130).EndValue(150);
        })
    )
)
@(Html.DevExtreme().CircularGauge() _
    .ID("circularGauge") _
    .Scale(Sub(scale)
        scale.StartValue(50) _
                .EndValue(50)
    End Sub) _
    .RangeContainer(Sub(rc)
        rc.Ranges(Sub(ranges)
            ranges.Add().StartValue(50).EndValue(90)
            ranges.Add().StartValue(90).EndValue(130)
            ranges.Add().StartValue(130).EndValue(150)
        End Sub)
    End Sub)
)

Note that DevExtreme widgets require you to link the jQuery library to your application. If you use the Knockout or AngularJS approach, the Knockout or AngularJS library is also required. For detailed information on linking these libraries to your project, refer to the topics in the Installation section.

View Demo Watch Video

See Also

Configuration

An object that defines configuration options for the CircularGauge widget.

Name Description
animation

Specifies animation options.

containerBackgroundColor

Specifies the color of the parent page element.

elementAttr

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

export

Configures the exporting and printing features.

geometry

Specifies the options required to set the geometry of the CircularGauge widget.

loadingIndicator

Configures the loading indicator.

margin

Generates space around the widget.

onDisposing

A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.

onDrawn

A handler for the drawn event.

onExported

A handler for the exported event.

onExporting

A handler for the exporting event.

onFileSaving

A handler for the fileSaving event.

onIncidentOccurred

A handler for the incidentOccurred event.

onInitialized

A handler for the initialized event. Executed only once, after the widget is initialized.

onOptionChanged

A handler for the optionChanged event. Executed after an option of the widget is changed.

onTooltipHidden

A handler for the tooltipHidden event.

onTooltipShown

A handler for the tooltipShown event.

pathModified

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

rangeContainer

Specifies gauge range container options.

redrawOnResize

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

rtlEnabled

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

scale

Specifies a gauge's scale options.

size

Specifies the size of the widget in pixels.

subvalueIndicator

Specifies the appearance options of subvalue indicators.

subvalues

Specifies a set of subvalues to be designated by the subvalue indicators.

theme

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

title

Specifies the widget title.

tooltip

Configures tooltips.

value

Specifies the main value on a gauge.

valueIndicator

Specifies the appearance options of the value indicator.

Methods

This section describes methods that can be used to manipulate the widget.

Name Description
beginUpdate()

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

element()

Gets the root element of the widget.

endUpdate()

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

exportTo(fileName, format)

Exports the widget into a document with a specified name and format.

getSize()

Gets the current size of the widget.

hideLoadingIndicator()

Conceals the loading indicator.

instance()

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

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()

Gets the widget's options.

option(optionName)

Gets a specific option value.

option(optionName, optionValue)

Assigns a new value to a specific option.

option(options)

Sets one or more options.

print()

Opens the browser's print window.

render()

Redraws the widget.

showLoadingIndicator()

Displays the loading indicator.

subvalues()

Returns an array of gauge subvalues.

subvalues(subvalues)

Updates gauge subvalues.

svg()

Returns the widget's SVG markup.

value()

Returns the main gauge value.

value(value)

Updates a gauge value.

Events

This section describes events fired by this widget.

Name Description
disposing

Raised when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.

drawn

Fires when the widget has finished drawing itself.

exported

Fires after data from the widget is exported.

exporting

Fires before data from the widget is exported.

fileSaving

Fires before a file with exported data is saved on the user's local storage.

incidentOccurred

Fires when an error or warning appears in a widget.

initialized

Raised only once, after the widget is initialized.

optionChanged

Raised after an option of the widget is changed.

tooltipHidden

Fires when an indicator's tooltip becomes hidden.

tooltipShown

Fires when an indicator's tooltip appears.

See Also

Indicator Types

This section lists objects that define options used to configure value and subvalue indicators of specific types.