JavaScript/jQuery CircularGauge Options
animation
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.
elementAttr
Specifies the attributes to be attached to the widget's root element.
You can configure this option in an ASP.NET MVC Control as follows:
@(Html.DevExtreme().WidgetName() .ElementAttr("class", "class-name") // ===== or ===== .ElementAttr(new { @id = "elementId", @class = "class-name" }) // ===== or ===== .ElementAttr(new Dictionary<string, object>() { { "id", "elementId" }, { "class", "class-name" } }) )
@(Html.DevExtreme().WidgetName() _ .ElementAttr("class", "class-name") ' ===== or ===== .ElementAttr(New With { .id = "elementId", .class = "class-name" }) ' ===== or ===== .ElementAttr(New Dictionary(Of String, Object) From { { "id", "elementId" }, { "class", "class-name" } }) )
export
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.
See Also
geometry
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.
loadingIndicator
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.
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
onDisposing
A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
onDrawn
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
onExported
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
onExporting
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
fileName |
The name of the file to which the widget is about to be exported. |
|
cancel |
Allows you to prevent exporting. |
|
format |
The resulting file format. One of PNG, PDF, JPEG, SVG and GIF. |
onFileSaving
A handler for the fileSaving event. Executed before a file with exported data is saved on the user's local storage.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
fileName |
The name of the file to be saved. |
|
format |
The format of the file to be saved. |
|
data |
Exported data as a BLOB. |
|
cancel |
Allows you to prevent file saving. |
onIncidentOccurred
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
target | any |
Information on 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 DevExtreme library.
onInitialized
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
You cannot access widget elements in this handler because it is executed before they are ready. Use the onDrawn handler instead.
onOptionChanged
Name | Type | Description |
---|---|---|
name |
The option's short name. |
|
model |
The model data. Available only if you use Knockout. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The widget's instance. |
|
fullName |
The option's full name. |
|
value | any |
The option's new value. |
onTooltipHidden
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
target |
Information on the (sub)value indicator being pressed or hovered over with the mouse pointer. Contains the type ("value-indicator" or "subvalue-indicator") and index (undefined for value indicators) fields. |
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
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
target |
Information on the (sub)value indicator being pressed or hovered over with the mouse pointer. Contains the type ("value-indicator" or "subvalue-indicator") and index (undefined for value indicators) fields. |
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
rangeContainer
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.
redrawOnResize
Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates.
When this option is set to true, the widget will be redrawn automatically in case the size of its parent window changes.
rtlEnabled
When this option is set to true, the widget text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.
DevExpress.config({ rtlEnabled: true });
scale
To divide a scale, set its startValue and endValue properties. The scale's major and minor ticks will be calculated automatically. 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.
subtitle
Use the subtitle property instead.
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
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.
subvalues
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.
var gaugeOptions = { // ... subvalues: [] }
Subvalues are designated by subvalue indicators. You can customize the appearance of these indicators using the subvalueIndicator configuration object.
theme
A theme is a widget configuration that gives the widget a distinctive appearance. Use can use one of the predefined themes or create a custom one. Changing the option values in the widget's configuration object overrides the theme's corresponding values.
When using the widget as an ASP.NET MVC Control, specify this option using the VizTheme
enum. This enum accepts the following values: GenericLight
, GenericDark
, GenericContrast
, GenericCarmine
, GenericDarkMoon
, GenericSoftBlue
, GenericDarkViolet
, GenericGreenMist
, Android5Light
, IOS7Default
, Win10Black
and Win10White
.
value
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.
See Also
- Update Data Demo: CircularGauge | LinearGauge
valueIndicator
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.
If you have technical questions, please create a support ticket in the DevExpress Support Center.