Data Visualization Widgets RangeSelector

A widget that allows end users to select a range of values on a scale.

Included in: dx.chartjs.js, dx.all.js
RangeSelector interactive configuration
Copy code
$("#rangeselector").dxRangeSelector({
});

This widget represents a scale (numeric or date-time) and two sliders. Select the required range by moving the sliders.

RangeSelector

You can create a widget using one of the following approaches.

  • jQuery
    Use the dxRangeSelector jQuery plug-in.

    HTML
    <div id="rangeSelectorContainer"></div>
    JavaScript
    $("#rangeSelectorContainer").dxRangeSelector({
        scale: {
            startValue: new Date(2011, 1, 1),
            endValue: new Date(2011, 6, 1),
            tickInterval: { days: 7 }
        }
    });
  • Knockout
    Add a div element and apply the dxRangeSelector binding to this element.

    HTML
    <div data-bind="dxRangeSelector: {
        scale: {
            startValue: new Date(2011, 1, 1),
            endValue: new Date(2011, 6, 1),
            tickInterval: { days: 7 }
        }
    }"></div>
  • Angular
    Add a div element and apply the dx-range-selector directive to this element.

    HTML
    <div dx-range-selector="{
        scale: {
            startValue: new Date(2011, 1, 1),
            endValue: new Date(2011, 6, 1),
            tickInterval: { days: 7 }
        }
    }"></div>

Note that DevExtreme widgets require you to link the jQuery and Globalize libraries to your application. If you use the Knockout or Angular approach, the Knockout or Angular library is also required. For detailed information on how to link the needed libraries, refer to the Installation article.

A chart can be displayed in the background of the dxRangeSelector widget. This allows end users to select the required range in a chart series. You can also integrate the dxRangeSelector widget with a stand-alone dxChart widget to emulate chart zooming and scrolling.

Start Tutorial View Demo Watch Video

See Also

To learn the widget's concepts and overview features, refer to the Range Selector section within the Data Visualization Guides.

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.

<div id="rangeSelectorContainer" style="height:120px;max-width:600px;margin:0px auto"></div>
$(function () {
    $("#rangeSelectorContainer").dxRangeSelector({
        dataSource: [
            { arg: 0 },
            { arg: 25 },
            { arg: 50 },
            { arg: 75 },
            { arg: 100 }
        ]
    });
});

Methods

This section describes the methods that can be used in code to manipulate objects related to the dxRangeSelector.

Events

This section describes events fired by this widget.