Bullet

The Bullet widget is useful when you need to compare a single measure to a target value. The widget comprises a horizontal bar indicating the measure and a vertical line indicating the target value.

Included in: dx.viz.js, dx.viz-web.js, dx.all.js
Module: viz/bullet
Export: default
Bullet interactive configuration
Copy Code
Copy to Codepen
$("#bullet").dxBullet({
});

                    

DevExtreme widgets are integrated with many popular libraries and frameworks. See the Installation section (for JavaScript libraries) or the Prerequisites and Installation section (for ASP.NET MVC framework) to find details on setting up DevExtreme with a particular library or framework.

The following code shows how to create the Bullet widget using every supported library and framework. For more details on working with widgets in these libraries and frameworks, see the Widget Basics topic for jQuery, Angular, AngularJS, Knockout or ASP.NET MVC.

jQuery
JavaScript
HTML
$(function () {
    $("#bullet").dxBullet({
        startScaleValue: 0,
        endScaleValue: 35,
        value: 27,
        target: 24 
    });
});
<div id="bullet"></div>
Angular
HTML
TypeScript
<dx-bullet
    [startScaleValue]="0"
    [endScaleValue]="35"
    [value]="27"
    [target]="24">
</dx-bullet>
import { DxBulletModule } from 'devextreme-angular';
// ...
export class AppComponent {
    // ...
}
@NgModule({
    imports: [
        // ...
        DxBulletModule
    ],
    // ...
})
AngularJS
HTML
<div dx-bullet="{
    startScaleValue: 0,
    endScaleValue: 35,
    value: 27,
    target: 24
}"></div>
Knockout
HTML
<div data-bind="dxBullet: {
    startScaleValue: 0,
    endScaleValue: 35,
    value: 27,
    target: 24 
}"></div>
ASP.NET MVC Controls
Razor C#
Razor VB
@(Html.DevExtreme().Bullet()
    .ID("bullet")
    .StartScaleValue(0)
    .EndScaleValue(35)
    .Value(27)
    .Target(24)
)
@(Html.DevExtreme().Bullet() _
    .ID("bullet") _
    .StartScaleValue(0) _
    .EndScaleValue(35) _
    .Value(27) _
    .Target(24)
)

View Demo Watch Video

See Also

Configuration

An object that specifies configuration options for the Bullet widget.

Methods

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

Events

This section describes events fired by this widget.

See Also