Configuration

An object that defines configuration options for the dxRangeSelector widget.

Show Example:
jQuery

This example shows how to display the dxRangeSelector 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/or 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.

Show Example:
jQuery

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


                                    

                                    

behavior

Specifies the dxRangeSelector'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 dxRangeSelector'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 dxRangeSelector 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 dxChart 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 Scrolling and Zooming topics.

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.

Show Example:
jQuery

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


                                    

                                    

containerBackgroundColor

Specifies the color of the parent page element.

Type: String
Default Value: undefined

Set this property to the color of the parent page element. Certain dxRangeSelector elements will use this color so that they coordinate with the page. For instance, the dxRangeSelector'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.

Type: Object|Array

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 majorTickInterval and minorTickInterval properties.

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 start and end values 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.


                                    

                                    

loadingIndicator

Specifies the appearance of the loading indicator.

Type: Object

In most cases, a range selector is quick enough to draw itself instantly for a viewer. There are cases, however, when the range selector takes longer to be drawn. In these cases, it is recommended that the loading indicator is displayed. Use the range selector's showLoadingIndicator() and hideLoadingIndicator() methods to manage the loading indicator. To specify its appearance, use the loadingIndicator configuration object.

Show Example:
jQuery

In this example, the chart options are assigned 3000 ms after the example is loaded. Until such a time, the loading indicator is displayed. Its background and font are changed using the backgroundColor and font options respectively. Make a note that these options should be specified at design-time so that the changes are applied at the right time.


                                    

                                    

margin

Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size).

Type: Object

Set the required values for the left, right, top and bottom margins using the margin object's corresponding properties.

RangeSelectorMargin ChartJS

pathModified

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

Type: Boolean
Default Value: false
Accepted Values: true|false

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, you can consider the base HTML tag. Also, we recommend you to enable this option if you place the widget inside the <iframe> tag.

redrawOnResize

Indicates whether to redraw a range selector when the size of the parent browser window changes or a mobile device is rotated.

Type: Boolean
Default Value: true
Accepted Values: true|false

When the redrawOnResize property is set to true, the dxRangeSelector’s size changes proportionally according to the current size of the parent window. Note that the dxRangeSelector’s container must not have a fixed size in this scenario.

When the redrawOnResize property is set to false, the dxRangeSelector keeps its size when the size of the parent window changes.

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

Type: Object

The selected range is the entire scale by default. To set the required range to be selected after the dxRangeSelector 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 selectedRangeChanged option.

Show Example:
jQuery

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


                                    

                                    

selectedRangeChanged

A callback function that is called when the selected range is changed.

Type: function
Function parameters:
selectedRange: Object

Defines the currently selected range.

Object structure:
endValue: Date|Number

An start value of the selected range.

Default Value: null

The dxRangeSelector widget allows you to specify a callback function that will be called when the selected range is changed. When implementing this function, use the fields of the object that is passed as the function's parameter.

This function can be called when moving a slider or after the movement of the slider has stopped. To specify the required mode, use the callSelectedRangeChanged property of the behavior configuration object.

To see an example of an implementation of this function, refer to the Zooming topic.

Show Example:
jQuery

In this example, the function assigned to the selectedRangeChanged field displays the selected range under the dxRangeSelector widget.


                                    

                                    

shutter

Specifies the options of the range selector's shutters.

Type: Object

Shutters are used in the dxRangeSelector widget to highlight the 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 in pixels the size of the dxRangeSelector widget.

Type: Object
Default Value: undefined

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

If you need to set a particular size (different from the container's size) for the dxRangeSelector widget, use the size configuration object. Assign the height and width in pixels to the height and width properties.

Show Example:
jQuery

In this example, the size of the dxRangeSelector 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.

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 by the range selector.

Type: String
Default Value: 'desktop'

Use this property to set a predefined or custom theme. The options defining the range selector appearance will be set to the values of the specified theme. You can override some of these values within the rangeSelectorOptions configuration object. To learn more about themes and theme implementation and customization, refer to the Themes topic.

Show Example:
jQuery

In this example, a custom theme is specified and applied to the range selector.