Configuration

An object that defines configuration options for the dxBarGauge widget.

animation

Specifies animation options.

Type: Object

To make your gauge "live", enable animation for it by setting the enabled option of the animation object to true. In this instance, the gauge bars will appear in motion. In addition, within the animation object you can set an appropriate easing mode using the easing option, and specify how long the animation should run using the duration option.

Show Example:
jQuery

In this example, the animation performs in the 'linear' mode and lasts for ten seconds.


                                    

                                    

backgroundColor

Specifies a color for the remaining segment of the bar's track.

Type: String
Default Value: '#e0e0e0'

dxBarGauge displays values in the form of several circular bars each placed on a separate track. Since a bar indicates a value, it occupies only a segment of this track. The remaining segment is drawn in the color specified by the backgroundColor option.

Show Example:
jQuery

In this example, the gauge background is colored in 'mistyrose'.


                                    

                                    

barSpacing

Specifies a distance between bars in pixels.

Type: Number
Default Value: 4

Show Example:
jQuery

In this example, the space between bars is decreased to 2 pixels using the barSpacing option.


                                    

                                    

baseValue

Specifies a base value for bars.

Type: Number
Default Value: 0
Cannot be used in themes.

By default, all bars start from the beginning of the gauge's scale. If you need to draw them starting from a specific scale value, assign the required value to the baseValue option. In this instance, each bar will display the range from the baseValue to the corresponding value specified to this bar.

Show Example:
jQuery

In this example, the space between bars is decreased to 2 pixels using the barSpacing option.


                                    

                                    

drawn

Deprecated

Use the onDrawn option instead.

endValue

Specifies an end value for the gauge's invisible scale.

Type: Number
Default Value: 100
Cannot be used in themes.

Show Example:
jQuery

In this example, the range of values that can be indicated by bars is specified using the startValue and endValue options.


                                    

                                    

geometry

Defines the shape of the gauge's arc.

Type: Object

Specify the startAngle and endAngle options of the geometry configuration object to customize the shape of the bar gauge's arc. This arc is drawn from the startAngle to the endAngle as illustrated by the following image.

GaugeGeometry ChartJS

Show Example:
jQuery

In this example, the gauge's arc stretches from 0° to -90°.


                                    

                                    

incidentOccured

Deprecated

Use the onIncidentOccurred option instead.

label

Specifies the options of the labels that accompany gauge bars.

Type: Object

Each gauge bar is accompanied by a label that usually displays the value of the bar. Use the options of the label object to customize the label's text, specify its format, precision, font, and distance between the label and the bar.

To hide labels, use the label | visible option or assign false straight to the label option.

View Demo

Show Example:
jQuery

In this example, several options of the labels are changed.


                                    

                                    

loadingIndicator

Specifies the appearance of the loading indicator.

Type: Object

Usually, the widget is quick enough to draw itself instantly for a viewer. There are, however, cases, when the widget takes longer to be drawn. In such cases, displaying the loading indicator is recommended. To display the loading indicator, assign true to the show field of the loadingIndicator object. Use other fields of this object to change the appearance of the loading indicator.

Show Example:
jQuery

In this example, the gauge values are assigned 2000 ms after the example is loaded. Until that time, the loading indicator is displayed. Its background and font are changed using the backgroundColor and font options respectively.


                                    

                                    

onDisposing

A handler for the disposing event.

Type: function
Function parameters:
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
Default Value: null

Assign a function to perform a custom action when you dispose of this component.

onDrawn

A handler for the drawn event.

Type: function(e)
Function parameters:
Information about the event.
Object structure:
component: Object
The widget instance.
element: Object
The widget's container.
Cannot be used in themes.

If you need to perform specific actions when the widget has finished drawing itself, assign a callback function to the drawn option. When implementing this function, you can access the drawn widget using the function's parameter.

onIncidentOccurred

A handler for the incidentOccurred event.

Type: function(e)
Function parameters:
Information about the event.
Object structure:
component: Object
The widget instance.
element: Object
The widget's container.
target: Object
Information about the occurred incident.

When an error or warning appears, the widget notifies you by passing a message to the browser console. This message contains the ID of the incident, a brief description, and a link to the Errors and Warnings section where further information about this incident can be found. However, you can handle errors and warnings in the way that you require. To do this, implement a callback function performing the required actions and assign it to the onIncidentOccurred option. Within this function, you can use information about the incident that occurred. This information can be accessed from the target field of the object passed to the callback function as a parameter. This information includes the following.

  • id
    Contains the ID of the incident. The full list of IDs can be found in the Errors and Warnings section.
  • type
    Contains the type of the incident. This field equals 'error' for errors or 'warning' for warnings.
  • args
    Contains the argument of the incident's message. The content of this field varies greatly, depending on the incident. For example, it may contain the name of the data source field that was not specified correctly, or the name of the option that was not set properly.
  • text
    Contains the text passed to the browser console. This text includes the content of the args field, if there are any.
  • widget
    Contains the name of the widget that produced the error or warning.
  • version
    Contains the currently used version of the ChartJS library.

onOptionChanged

A handler for the optionChanged event.

Type: function
Function parameters:
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element.
value: any
Specifies a new value for the option.
Default Value: null

Assign a function to perform a custom action after an option of the component is changed.

palette

Sets the name of the palette or an array of colors to be used for coloring the gauge range container.

Type: String
Default Value: 'Default'
Accepted Values: 'Default' | 'Soft Pastel' | 'Harmony Light' | 'Pastel' | 'Bright' | 'Soft' | 'Ocean' | 'Vintage' | 'Violet'

Use this option to set a predefined or custom palette. The colors listed in the specified palette will be used to draw bars. If the number of the bars is greater than the number of colors in the palette, palette colors are repeated, but slightly modified.

In addition, you can declare an array of colors and use it as a palette. Refer to the Palettes topic for more information on palettes.

View Demo

Show Example:
jQuery

Use the drop-down menu below to choose which palette to use for coloring bars.


                                    

                                    

pathModified

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

Type: Boolean
Default Value: false
Cannot be used in themes.

If you place a widget on a page that uses a path modifier, notify the widget about it by setting the pathModified option to true. As an example of such modifiers, the base HTML tag can be considered. Also, we recommend you enable this option if you place the widget inside the <iframe> tag.

redrawOnResize

Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates.

Type: Boolean
Default Value: true

When this option is set to true, the widget will be redrawn automatically in case the size of its parent window changes.

NOTE: To redraw the widget after the size of its container has changed, call the render() method of the widget instance.

relativeInnerRadius

Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar.

Type: Number
Default Value: 0.3

This option accepts values from the (0, 1) range.

Show Example:
jQuery

In this example, the relativeInnerRadius option is set to 0.6.


                                    

                                    

rtlEnabled

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

Type: Boolean
Default Value: false
Cannot be used in themes.

The most common scenario is switching all the widgets to a right-to-left reading order. In this instance, set the DevExpress.rtlEnabled field to true. If you need to switch the reading order in a particular widget, use the rtlEnabled configuration option of this widget.

size

Specifies the size of the widget in pixels.

Type: Object

The widget occupies the entire area of the parent container (division). If the container size (width or height) is set to zero, the widget is not displayed.

To set the widget to a specific size that differs from the container size, use the size configuration object. Assign a height and width in pixels to the height and width fields of this object respectively.

Show Example:
jQuery

In this example, the size of the dxBarGauge widget is less than the container size.


                                    

                                    

startValue

Specifies a start value for the gauge's invisible scale.

Type: Number
Default Value: 0
Cannot be used in themes.

Show Example:
jQuery

In this example, the range of values that can be indicated by bars is specified using the startValue and endValue options. Note that here the start value is greater than the end value. As a result, the bars grow from the right end of the bar tracks.


                                    

                                    

subtitle

Specifies a subtitle for a gauge.

Type: Object|String

This option specifies the appearance of the gauge subtitle (the text below the title). If you need to specify only the subtitle text, assign it directly to the subtitle field. Otherwise, assign an object with the required subtitle options specified to the subtitle option. When a subtitle is not specified, the widget is displayed without it.

Show Example:
jQuery

In this example, the subtitle text is assigned directly to the subtitle field.


                                    

                                    

theme

Specifies the name of the theme to be applied.

Type: String
Default Value: 'desktop'

Use this option to specify the name of the theme that should be applied to a widget. For information on customizing and implementing themes, refer to the Themes topic.

Show Example:
jQuery

This example shows how to implement a custom theme on the base of a predefined one.


                                    

                                    

title

Specifies a title for a gauge.

Type: Object|String

Use this option to set a text for the gauge title. If you need to specify only a text for the title, assign this text directly to the title field. Otherwise, assign an object with the required title options specified to the title option. When title is not specified, the widget is displayed without a title.

Show Example:
jQuery

In this example, the title text is assigned directly to the title field.


                                    

                                    

tooltip

Specifies options for gauge tooltips.

Type: Object

A tooltip is a small pop-up rectangle that displays the value of the bar that is currently hovered over. You can enable or disable tooltips, format or customize the displayed text, and change the default appearance. Use the options of the tooltip configuration object to do this.

View Demo

Show Example:
jQuery

In this example, several options of tooltips are changed. Hover over any bar to see its tooltip.


                                    

                                    

values

Specifies the array of values to be indicated on a bar gauge.

Type: Array
Default Value: []
Cannot be used in themes.

Apart from specifying an array of values when configuring the dxBarGauge widget, you can obtain this array at runtime using the values() method, and change it using the values(newValues) method.

Show Example:
jQuery

In this example, bars indicate a set of values specified by the values option.