Vue BarGauge Props

An object that defines configuration options for the BarGauge 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.

backgroundColor

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

Type:

String

Default Value: '#e0e0e0'

BarGauge 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.

barSpacing

Specifies a distance between bars in pixels.

Type:

Number

Default Value: 4

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.

elementAttr

Specifies the attributes to be attached to the widget's root element.

Type:

Object

Default Value: {}

You can configure this option in an ASP.NET MVC Control as follows:

Razor C#
Razor VB
@(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" }
    })
)

endValue

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

Type:

Number

Default Value: 100
Cannot be used in themes.

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

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

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, 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

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. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

Default Value: null

onDrawn

A function that is executed when the widget's rendering has finished.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

Default Value: null
Cannot be used in themes.

onExported

A handler for the exported event. Executed after data from the widget is exported.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

Default Value: null

onExporting

A handler for the exporting event. Executed before data from the widget is exported.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

fileName

String

The name of the file to which the widget is about to be exported.

cancel

Boolean

Allows you to prevent exporting.

format

String

The resulting file format. One of PNG, PDF, JPEG, SVG and GIF.

Default Value: null

onFileSaving

A handler for the fileSaving event. Executed before a file with exported data is saved on the user's local storage.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

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

Allows you to prevent file saving.

Default Value: null

onIncidentOccurred

A handler for the incidentOccurred event. Executed when an error or warning appears in the widget.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

target any

Information on the occurred incident.

Default Value: null

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

A handler for the initialized event. Executed only once, after the widget is initialized.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

Default Value: null

You cannot access widget elements in this handler because it is executed before they are ready. Use the onDrawn handler instead.

onOptionChanged

A handler for the optionChanged event. Executed after an option of the widget is changed.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
name

String

The option's short name.

model

Object

The model data. Available only if you use Knockout.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

component

Object

The widget's instance.

fullName

String

The option's full name.

value any

The option's new value.

Default Value: null

onTooltipHidden

A handler for the tooltipHidden event.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

target

Object

Information on the bar being pressed or hovered over with the mouse pointer. Contains the index field.

Default Value: null
Cannot be used in themes.

The bar's tooltip becomes invisible when a user hovers the mouse cursor over another bar 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 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 bar. You can use its index field to get the index of the hovered bar.

onTooltipShown

A handler for the tooltipShown event.

Type:

Function

Function parameters:
e:

Object

Information about the event.

Object structure:
Name Type Description
component

Object

The widget's instance.

element

HTMLElement | jQuery

The widget's container. It is an HTML Element or a jQuery Element when you use jQuery.

model

Object

The model data. Available only if you use Knockout.

target

Object

Information on the bar being pressed or hovered over with the mouse pointer. Contains the index field.

Default Value: null
Cannot be used in themes.

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

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 bar. You can use its index field to get the index of the hovered bar.

palette

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

Type:

Array<String>

|

String

Default Value: 'Default'
Accepted Values: 'Default' | 'Soft Pastel' | 'Harmony Light' | 'Pastel' | 'Bright' | 'Soft' | 'Ocean' | 'Vintage' | 'Violet' | 'Carmine' | 'Dark Moon' | 'Soft Blue' | 'Dark Violet' | 'Green Mist'

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.

When using the widget as an ASP.NET MVC Control, you can specify this option using the VizPalette enum. This enum accepts the following values: Default, SoftPastel, HarmonyLight, Pastel, Bright, Soft, Ocean, Vintage, Violet, Carmine, DarkMoon, SoftBlue, DarkViolet and GreenMist.

View Demo

pathModified

Notifies the widget that it is embedded into an HTML page that uses a tag modifying the path.

Type:

Boolean

Default Value: false
Cannot be used in themes.

If you place the widget on a page that uses a tag modifying the path (<base>, <iframe>, etc.), some of the widget elements may get mixed up or disappear. To solve this problem, set the pathModified option to true.

See Also

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's 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.

rtlEnabled

Switches the widget to a right-to-left representation.

Type:

Boolean

Default Value: false
Cannot be used in themes.

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.

JavaScript
DevExpress.config({
    rtlEnabled: true
});

size

Specifies the widget's size in pixels.

Type:

Object

Default Value: undefined

The widget occupies its container's entire area by default. Use the size object to specify the widget's size if it should be different from that of its container. Assign 0 to size object's height and width options to hide the widget.

startValue

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

Type:

Number

Default Value: 0
Cannot be used in themes.

subtitle Deprecated

Use the subtitle property instead.

Specifies a subtitle for the widget.

Type:

Object

|

String

theme

Sets the name of the theme the widget uses.

Type:

String

Default Value: 'generic.light'
Accepted Values: 'generic.light' | 'generic.dark' | 'generic.contrast' | 'generic.carmine' | 'generic.darkmoon' | 'generic.softblue' | 'generic.darkviolet' | 'generic.greenmist' | 'android5.light' | 'ios7.default'

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.

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.

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.

title

Configures the widget's title.

Type:

Object

|

String

tooltip

Configures tooltips.

Type:

Object

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

View Demo

values

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

Type:

Array<Number>

Default Value: []
Cannot be used in themes.

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

View Demo