Configuration

An object that defines configuration options for the CircularGauge 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 indicators 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 | duration option is changed to 2000 ms. In addition, the animation easing mode is changed to 'linear' using the animation | easing option. Switch between the radio buttons to see how the gauge animation performs with these settings.


                                    

                                    

containerBackgroundColor

Specifies the color of the parent page element.

Type: String
Default Value: 'none'

Set this property to the color of the parent page element. Certain elements of the widget will use this color so that they coordinate with the page. Currently, different auxiliary separators use the container background color, so there is no need to set a custom color for them.

Show Example:
jQuery

In this example, the containerBackgroundColor option is set to olive.


                                    

                                    

export

Configures the exporting and printing features.

Type: Object

These features allow a user to export your widget into a document or print it. When exporting is enabled, the "Exporting/Printing" button appears in the widget. A click on it invokes a drop-down menu that lists exporting and printing commands. The following formats are supported for exporting into: PNG, PDF, JPEG, SVG and GIF.

NOTE
IE9 and Safari on Mac OS do not implement an API for saving files. Therefore, exporting in these browsers requires setting up a server-side proxy. For details, refer to the proxyUrl option description.
See Also

Watch Video

geometry

Specifies the options required to set the geometry of the CircularGauge widget.

Type: Object

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

GaugeGeometry ChartJS

View Demo

Show Example:
jQuery

In this example, the gauge's arc stretches from 135° to 45°.


                                    

                                    

loadingIndicator

Configures the loading indicator.

Type: Object

When the widget visualizes local data, loading is instant. But when the widget is bound to a remote data source, loading may takes a considerable amount of time. To keep the viewer's attention, the widget can display a loading indicator.

DevExtreme HTML5 Charts LoadingIndicator

To activate the loading indicator, assign true to the loadingIndicator | show option. Once data is loaded, the loading indicator will be hidden automatically.

See Also

margin

Generates space around the widget.

Type: Object

WidgetMargin DevExtreme ChartJS

onDisposing

A handler for the disposing event.

Type: function
Function parameters:
e: Object
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. Available only in the Knockout approach.
Default Value: null

Assign a function to perform a custom action when the widget is being removed.

NOTE
The function assigned to this option is executed only if the widget is removed using the remove(), empty(), or html() jQuery methods.

onDrawn

A handler for the drawn event.

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

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

onExported

A handler for the exported event.

Type: function(e)
Function parameters:
e: Object
Information about the event.
Object structure:
component: Object
The widget instance.
element: jQuery
The widget's container.
model: Object
Data that is available for binding against the element. Available only in the Knockout approach.
Default Value: null

To perform a custom action after data from the widget is exported, assign a function to this option. For example, this function can notify the user that the exporting has been completed. Within this function, you can use the object passed to it as the parameter.

See Also
  • export - configures client-side export and printing.
  • onExporting - allows you to request exporting details and prevent exporting.
  • onFileSaving - allows you to access exported data and/or prevent it from being saved into a file on the user's local storage.

onExporting

A handler for the exporting event.

Type: function(e)
Function parameters:
e: Object
Information about the event.
Object structure:
component: Object
The widget instance.
element: jQuery
The widget's container.
model: Object
Data that is available for binding against the element. Available only in Knockout and AngularJS approaches.
fileName: String
The name of the file to which the widget is about to be exported.
cancel: Boolean
Assign true to this field if you need to prevent exporting.
Default Value: null

To perform a custom action before data from the widget is exported, assign a function to this option. Within this function, you can use the object passed to it as the parameter. For example, using the cancel field of this object, you can cancel exporting.

See Also
  • export - configures client-side export and printing.
  • onExported - allows you to notify an end user when exporting is completed.
  • onFileSaving - allows you to access exported data and/or prevent it from being saved into a file on the user's local storage.

onFileSaving

A handler for the fileSaving event.

Type: function(e)
Function parameters:
e: Object
Information about the event.
Object structure:
component: Object
The widget instance.
element: jQuery
The widget's container.
fileName: String
The name of the file to be saved.
format: String
The format of the file to be saved.
Possible Values: 'PNG' | 'PDF' | 'JPEG' | 'SVG' | 'GIF'
data: BLOB
Exported data as a BLOB.
cancel: Boolean
Assign true to this field if you need to prevent the file from being saved.
Default Value: null

To perform a custom action before a file with exported data is saved on the user's local storage, assign a function to this option. Within this function, you can use the object passed to it as the parameter. For example, using the cancel field of this object, you can cancel file saving.

See Also
  • export - configures client-side export and printing.
  • onExporting - allows you to request exporting details and prevent exporting.
  • onExported - allows you to notify an end user when exporting is completed.

onIncidentOccurred

A handler for the incidentOccurred event.

Type: function(e)
Function parameters:
e: Object
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.

onInitialized

A handler for the initialized event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
element: jQuery
An HTML element of the widget.
Default Value: null

Assign a function to perform a custom action when the widget is initialized.

onOptionChanged

A handler for the optionChanged event.

Type: function
Function parameters:
e: Object
Provides function parameters.
Object structure:
component: Object
Provides access to the widget instance.
name: String
Specifies the name of the option whose value is changed.
fullName: String
Specifies a full name of the option whose value is changed. The full name is formed by concatenating the names of the options that are presented in the hierarchy of the given option. The names are delimited by commas.
value: any
Specifies a new value for the option.
element: jQuery
An HTML element of the widget.
model: Object
Provides access to the data that is available for binding against the element. Available only in the Knockout approach.
Default Value: null

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

onTooltipHidden

A handler for the tooltipHidden event.

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

The indicator's tooltip becomes invisible when a user hovers the mouse cursor over another indicator or moves it outside the widget.

When a tooltip is made hidden, you can perform specific actions by handling the tooltipHidden event. To do this, implement a handling function and assign it to this option. When implementing a handling function, use the object passed to it as its parameter. This object will provide you with the widget instance, its container and the object describing the hovered indicator. You can use its index field to get the index of the hovered subvalue indicator (the index of the main value indicator is undefined).

onTooltipShown

A handler for the tooltipShown event.

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

The tooltip appears when a user hovers the mouse cursor over an indicator.

When a tooltip appears, you can perform specific actions by handling the tooltipShown event. To do this, implement a handling function and assign it to this option. When implementing this function, use the object passed to it as its parameter. This object will provide you with the widget instance, its container and the object describing the hovered indicator. You can use its index field to get the index of the hovered subvalue indicator (the index of the main value indicator is undefined).

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.

rangeContainer

Specifies gauge range container options.

Type: Object

For the purpose of more intelligible data visualization, you can combine values into ranges and color each range differently. For instance, you can indicate the range of warm and cold temperatures. To set the ranges, assign an array of objects defining the ranges to the ranges property of the rangeContainer configuration object. In addition, you can specify the orientation of the ranges relative to an invisible scale line, and an offset from this line using the rangeContainer properties.

Show Example:
jQuery

In this example, a number of options within the rangeContainer configuration object is changed. The range container is divided into ranges that are defined by the ranges option. These ranges are moved from the scale to a 5-pixel distance using the offset option. In addition, the backgroundColor option is set to firebrick.


                                    

                                    

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
Cannot be used in themes.

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.

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.

scale

Specifies a gauge's scale options.

Type: Object

To divide a scale, set its startValue and endValue properties. The scale's major and minor ticks will be calculated automatically, so that the tick labels do not overlap each other. Major ticks will be shown by default. To show minor ticks, set their visible property to true. You can set custom major and minor tick intervals, show custom major and minor ticks, and format tick labels. These and other scale options are available in the scale configuration object.

Show Example:
jQuery

In this example, several options of the gauge scale are changed. The scale is divided using the startValue and endValue options. Both the major and minor scale ticks are colored in black. In addition, the scale labels are displayed in a currency format.


                                    

                                    

size

Specifies the size of the widget in pixels.

Type: Object
Default Value: undefined

By default, the widget occupies the entire area of the parent container. If you need to set a particular size for the widget, different from the container's size, assign a height and width in pixels to height and width properties of the size object.

Using the size object, you can hide the widget. For this purpose, simply assign 0 to both the height and width of the widget.

Show Example:
jQuery

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


                                    

                                    

subtitle

Deprecated

Use the subtitle option instead.

Specifies a subtitle for the widget.

Type: Object|String

Use this property to set the text to be displayed as a gauge subtitle (the text below the title). If you need to specify the subtitle's font, assign an object to the subtitle property with the required options specified. In this instance, set the subtitle's text using the text property. When text is not specified for a subtitle, the widget is displayed without a subtitle.

subvalueIndicator

Specifies the appearance options of subvalue indicators.

Type: Object

The CircularGauge widget can display one main value and several subvalues. The gauge's main value and subvalues are indicated by special pointers. You can customize the appearance of these pointers using the valueIndicator and subvalueIndicator configuration objects correspondingly.

The subvalue indicator is a pointer which designates an extra value on a scale. There are several types of subvalue indicators. Set the required one by using the type option, and then specify the options that are specific to this type, if needed. To learn about the options that can be specified for a particular type, refer to one of the following sections.

View Demo

Show Example:
jQuery

In this example, several options of the subvalueIndicator configuration object are changed. Here, the gauge subvalues are indicated by triangle markers. The appearance of these markers is customized using the color and length options.


                                    

                                    

subvalues

Specifies a set of subvalues to be designated by the subvalue indicators.

Type: Array
Default Value: undefined
Cannot be used in themes.

In addition to one main value, you can indicate several extra values on a gauge. These are called subvalues. To specify the subvalues, assign an array with them to the subvalues field.

You can obtain and change the subvalues at runtime. In order to do this, use the subvalues() and subvalues(subvalues) methods. Note that in that case, you need to initialize the subvalues option at least with an empty array.

JavaScript
var gaugeOptions = {
    // ...
    subvalues: []    
}

Subvalues are designated by subvalue indicators. You can customize the appearance of these indicators using the subvalueIndicator configuration object.

Show Example:
jQuery

In this example, several subvalues are displayed on the gauge.


                                    

                                    

theme

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

Type: String
Default Value: 'generic.light'
Accepted Values: 'generic.light' | 'generic.dark' | 'generic.contrast' | 'android5.light' | 'ios7.default' | 'win10.black' | 'win10.white'

Use this property to set a predefined or custom theme. The options defining chart appearance will be set to the values that are set in the specified theme. You can override some of these values within the chart's configuration object.

NOTE
The following themes were deprecated or renamed: 'desktop', 'desktop-dark', 'android', 'android-holo-light', 'ios', 'win8', 'win8-white', 'win8.white', 'win8.black'. In new applications, use themes listed in the accepted values.
Show Example:
jQuery

In this example, a custom theme is implemented and applied to a gauge. In addition, you can change the type of the value indicator using the drop-down menu under the gauge. Note that options for the value indicator of each type are specified in separate objects within the gauge | valueIndicator configuration object.


                                    

                                    

title

Specifies the widget title.

Type: Object|String

Use this property to set the text to be displayed as the widget title. If you need to specify the title's position in the widget, assign an object to the title property with the required fields specified. In this instance, set the title's text using the text property.

The widget can display additional text in the subtitle. It is placed under the title. Use properties of the subtitle object to assign a text to the subtitle and change its font.

Show Example:
jQuery

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


                                    

                                    

tooltip

Configures tooltips.

Type: Object

A tooltip is a miniature rectangle displaying the value of a gauge's indicator. A tooltip appears when the end-user hovers the cursor over an indicator. You can enable/disable tooltips, change their appearance and format their text using fields of the tooltip configuration object.

Show Example:
jQuery

In this example, a number of the tooltip options are changed. The tooltip value is displayed in a currency format with the precision of 2. In addition, the font size and weight options are changed. To see the tooltip, hover over the red range bar.


                                    

                                    

value

Specifies the main value on a gauge.

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

The main value is designated by the value indicator. To customize the appearance of the value indicator, use the valueIndicator configuration object.

You can obtain and change the gauge value at runtime. In order to do this, use the value() and value(value) methods.

Only one main value can be indicated on a gauge. Besides the main gauge value, you can indicate several extra values. Refer to the subvalues option description for more information.

Show Example:
jQuery

Use the buttons under the gauge to change the value displayed by the value indicator. –°lick the Decrease the Value button to reduce the value by 10. Click the Restore button to set the value to 100.


                                    

                                    

valueIndicator

Specifies the appearance options of the value indicator.

Type: Object

The value indicator is a pointer which designates the main value of the gauge. There are several types of value indicators. Set the required one by using the type option, and then specify the options that are specific to this type, if needed. To learn the options that can be specified for a particular type, refer to one of the following sections.

View Demo

Show Example:
jQuery

In this example, several options of the valueIndicator configuration object are changed. Here, the gauge value is indicated by a two-color needle. The appearance of this needle is customized using the color, secondColor and width options. In addition, the look of the spindle is altered using the spindleSize and spindleGapSize options.