Configuration

An object that defines configuration options for the RangeSelector widget.

Show Example:
jQuery

This example shows how to display the RangeSelector widget. The only option which is specifically set is the dataSource. The other option - the dataSourceField - thought required, does not have to be specified because it is set to 'arg' (a required data source field) by default.


                                    

                                    

background

Specifies the options for the range selector's background.

Type: Object

A background is an area that is painted in a specified color. You can change this color by setting the background's color property and by displaying an image specified by the image configuration object. In addition, you can superimpose a chart on a background by specifying the chart configuration object. The chart will be shown with the specified background color. To show the chart without a background, set the background's visible property to false.

NOTE
You can use this option only when the range selector displays an image or chart. If not, use the selectedRangeColor and tick to customize the appearance of your widget.
Show Example:
jQuery

In this example, the color of the background is changed to lightblue.


                                    

                                    

behavior

Specifies the RangeSelector's behavior options.

Type: Object

Show Example:
jQuery

In this example, a number of options belonging to the behavior configuration object are changed. Particularly, the snapToTicks option is set to 'false', so the RangeSelector's sliders do not dock to the scale ticks. These sliders cannot swap their places as the allowSlidersSwap option is also set to 'false'. In addition, widget animation is disabled by setting the animationEnabled option to 'false'.


                                    

                                    

chart

Specifies the options required to display a chart as the range selector's background.

Type: Object

The RangeSelector widget can be created with a chart as the background. In this instance, the range selector can be used for selecting the required range on the chart. At the same time, the Chart widget can be displayed near the range selector and zoomed or scrolled according to the range selected in the range selector. For details on how to synchronize these two widgets, refer to the Zooming and Scrolling topic.

To provide a data source for the chart located in the background, set the dataSource property of the rangeSelectorOptions root configuration object and define the series within the chart configuration object. Set the chart series' argumentField and valueField properties to the corresponding data source fields. The argument field will also be used to create the range selector's scale.

NOTE
You may need to use the rangeValue1Field and rangeValue2Field properties instead of the valueField property if you define range-like series. For the candleStick and stock series types, specific properties should also be specified instead of the valueField property.

The color specified for the range selector's background will also be visible in the chart's background by default. You can change it using the color property of the background configuration object. To prohibit the display of the background color, set the background's visible property to false.

View Demo

Show Example:
jQuery

In this example, a chart is displayed in the background of the RangeSelector widget.


                                    

                                    

containerBackgroundColor

Specifies the color of the parent page element.

Type: String
Default Value: '#FFFFFF'

Set this property to the color of the parent page element. Certain RangeSelector elements will use this color to coordinate with the page. For instance, the RangeSelector's shutters use this color, but you can change this color to a custom color.

Show Example:
jQuery

In this example, the containerBackgroundColor option is set to 'aquamarine'.


                                    

                                    

dataSource

Specifies a data source for the scale values and for the chart at the background.

Cannot be used in themes.

Use this property in the following cases:

  • to initialize a scale with data from one of the data source fields. Set the dataSourceField property to specify which field to use as the source for scale values.
  • to plot a chart using data from the data source fields. In this case, define the chart series by setting their argumentField and valueField properties. The range selector's scale will represent the chart's argument axis. It is created using data from the field specified by the chart's argumentField property.

The maximum and minimum values of the field specified by the argumentField/dataSourceField property are used as the scale's start and end values. The major tick interval is determined automatically. You can also set the interval using the scale's tickInterval and minorTickInterval properties.

For details on how to configure a data source, refer to the Data Binding topic.

Show Example:
jQuery

In this example, the dataSource field is used to set the data source for both the scale and the chart.


                                    

                                    

dataSourceField

Specifies the data source field that provides data for the scale.

Type: String
Default Value: 'arg'

Use this property to initialize a scale with data from one of the data source's fields. Set the name of the required data source field to this property.

Show Example:
jQuery

In this example, the 'x' field of the data source is set as the data source field for the scale using the dataSourceField option.


                                    

                                    

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

indent

Range selector's indent options.

Type: Object

The indent is used to precisely align scales of several widgets arranged vertically. This is the distance between the container edge and the range selector's scale (see the image below).

RangeSelectorMargin ChartJS

Note that if the indent is set very small, the Scale Labels will be cut.

Show Example:
jQuery

Move the sliders at the bottom to change the range selector's left and right indent values.


                                    

                                    

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:

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:

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:

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:

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.

format: String

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

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:

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:

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:

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:

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.

onSelectedRangeChanged

A handler for the selectedRangeChanged event.

Type: function(e)
Function parameters:

Information about the event.

Object structure:
component: Object
element: Object

The widget's container.

startValue: Date|Number

The updated start range value.

endValue: Date|Number

The updated end range value.

Default Value: null
Cannot be used in themes.

When implementing a handling function, use the object passed to it as the parameter. Among the fields of this object, you can find updated start and end range values.

View Demo

Show Example:
jQuery

In this example, the function assigned to the onSelectedRangeChanged field displays the selected range under the RangeSelector widget.


                                    

                                    

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
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 options of the range selector's scale.

Type: Object

To divide a scale, either set the dataSource property or the startValue and endValue properties. In the former case, the start and end values will be calculated based on the values provided by the data source field that is set by the dataSourceField property.

The scale's ticks are arranged automatically, based on the start and end values, so that the tick labels do not overlap each other. You can set a custom tick interval, add minor ticks and format tick labels. These and other scale options are available in the scale configuration object.

Show Example:
jQuery

In this example, the scale is divided using the values assigned to the startValue and endValue fields, and major tick interval is set to 2 using the majorTickInteval option. In addition, minor ticks are hidden, because the showMinorTicks option is set to 'false'.


                                    

                                    

selectedRange

Specifies the range to be selected when displaying the RangeSelector.

Type: Object

The selected range is the entire scale by default. To set the required range to be selected after the RangeSelector widget is displayed on a page, set the startValue and endValue properties for the selectedRange configuration object.

You can write a callback function to react to a change in the selected range. Assign this function to the onSelectedRangeChanged option.

Show Example:
jQuery

In this example, the [2, 5] range is set as a selected range after the RangeSelector widget is displayed.


                                    

                                    

selectedRangeColor

Specifies the color of the selected range.

Type: String
Default Value: '#606060'

Show Example:
jQuery

Use the color box at the bottom to change the selectedRangeColor value.


                                    

                                    

shutter

Specifies range selector shutter options.

Type: Object

Shutters are used in the RangeSelector widget with the background (image or chart) to hide the non-selected range. When using shutters, the background area for a selected range is clearly visible, and the remaining area is hidden by the shutters.

Show Example:
jQuery

In this example, the shutter's color and opacity options are changed.


                                    

                                    

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 RangeSelector widget is set smaller than the size of the container. The container border is displayed.


                                    

                                    

sliderHandle

Specifies the appearance of the range selector's slider handles.

Type: Object

The range selector's sliders consist of a slider marker and a slider handle. You can drag a marker or a handle to change the selected range. To set the appearance options of the slider handles, use the sliderHandle configuration object. To customize the slider markers, use the sliderMarker configuration object.

Show Example:
jQuery

In this example, the slider handles are colored in 'brown' using the color option. In addition, the width and opacity options of the sliderHandle configuration object are changed.


                                    

                                    

sliderMarker

Defines the options of the range selector slider markers.

Type: Object

When moving a slider, its marker displays the currently selected scale value. Use the sliderMarker object to set the required options for the range selector slider markers. For instance, you can format the markers' text, change the text font, or make the markers invisible.

View Demo

Show Example:
jQuery

In this example, several options of the sliderMarker configuration object are changed.


                                    

                                    

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 specified and applied to the range selector.


                                    

                                    

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.