Bullet

A bullet graph widget.

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

The dxBullet widget holds a horizontal bar indicating a primary value and a vertical line indicating a target value. This widget is useful when you need to visualize task implementation progress.

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

  • jQuery
    Use the dxBullet jQuery plug-in.

    HTML
    <div id="bulletContainer"></div>
    JavaScript
    $("#bulletContainer").dxBullet({
        startScaleValue: 0,
        endScaleValue: 35,
        value: 27,
        target: 24 
    });
  • Knockout
    Add a div element and apply the dxBullet binding to this element.

    HTML
    <div data-bind="dxBullet: {
        startScaleValue: 0,
        endScaleValue: 35,
        value: 27,
        target: 24 
    }"></div>
  • Angular
    Add a div element and apply the dx-bullet directive to this element.

    HTML
    <div dx-bullet="{
        startScaleValue: 0,
        endScaleValue: 35,
        value: 27,
        target: 24 
    }"></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. For detailed information on creating widgets, refer to the Create a Widget article.

View Demo Watch Video

Configuration

An object that specifies configuration options for the dxBullet widget.

Methods

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

Events

This section describes events exposed by this widget.

To handle events, use one of the following methods.

  • Attach a handler to a widget option
    Assign a callback function to the widget option that takes on a handler for the required event. The events that can be handled within the widget's configuration object are listed in the Configuration section. All these events have names starting with on.

  • Attach several handlers for one or several events to a widget
    Specify event handling functions for one or more events using the on() method. All the widget events are listed in the Events section.