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({
});

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

  • jQuery

    HTML
    <div id="bullet"></div>
    JavaScript
    $(function () {
        $("#bullet").dxBullet({
            startScaleValue: 0,
            endScaleValue: 35,
            value: 27,
            target: 24 
        });
    });
  • 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 Wrappers

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

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 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.