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.

See Also

View Demo Watch Video

Configuration

An object that specifies configuration options for the dxBullet widget.

Name Description
color

Specifies a color for the bullet bar.

endScaleValue

Specifies an end value for the invisible scale.

margin

Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels.

onDisposing

A handler for the disposing event.

onDrawn

A handler for the drawn event.

onIncidentOccurred

A handler for the incidentOccurred event.

onInitialized

A handler for the initialized event.

onOptionChanged

A handler for the optionChanged event.

onTooltipHidden

A handler for the tooltipHidden event.

onTooltipShown

A handler for the tooltipShown event.

pathModified

Notifies a widget that it is embedded into an HTML page that uses a path modifier.

rtlEnabled

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

showTarget

Specifies whether or not to show the target line.

showZeroLevel

Specifies whether or not to show the line indicating zero on the invisible scale.

size

Specifies the size of the widget.

startScaleValue

Specifies a start value for the invisible scale.

target

Specifies the value indicated by the target line.

targetColor

Specifies a color for both the target and zero level lines.

targetWidth

Specifies the width of the target line.

theme

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

tooltip

Specifies tooltip options.

value

Specifies the primary value indicated by the bullet bar.

Methods

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

Name Description
beginUpdate()

Prevents the component from refreshing until the endUpdate method is called.

element()

Returns the root HTML element of the widget.

endUpdate()

Enables the component to refresh after the beginUpdate method call.

instance()

Returns an instance of this component class.

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

Returns the configuration options of this component.

option(optionName)

Gets the value of the specified configuration option of this component.

option(optionName, optionValue)

Sets a value to the specified configuration option of this component.

option(options)

Sets one or more options of this component.

render()

Redraws a widget.

svg()

Returns the widget's SVG markup.

Events

This section describes events exposed by this widget.

Name Description
disposing

Fires when the widget is being removed.

drawn

Fires when the widget has finished drawing itself.

incidentOccurred

Fires when an error or warning appears in a widget.

initialized

Fires when the widget is initialized.

optionChanged

Fires after an option of the component is changed.

tooltipHidden

Fires when a sparkline's tooltip becomes hidden.

tooltipShown

Fires when a sparkline tooltip appears.