LinearGauge

The LinearGauge is a widget that indicates values on a linear numeric scale.

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

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

jQuery
JavaScript
HTML
$(function () {
    $("#linearGauge").dxLinearGauge({
        scale: {
            startValue: 50,
            endValue: 150
        },    
        rangeContainer: {
            ranges: [
                { startValue: 50, endValue: 90 },
                { startValue: 90, endValue: 130 },
                { startValue: 130, endValue: 150 }
            ]
        },
        value: 105
    });
});
<div id="linearGauge"></div>
Angular
HTML
<dx-linear-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-linear-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="dxLinearGauge: {
    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().LinearGauge()
    .ID("linearGauge")
    .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().LinearGauge() _
    .ID("linearGauge") _
    .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.

Start Tutorial View Demo Watch Video

See Also

Configuration

An object that defines configuration options for the LinearGauge widget.

Methods

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

Events

This section describes events fired by this widget.

See Also

Indicator Types

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