$(() => {
$('#range-selector').dxRangeSelector({
margin: {
left: 15,
right: 15,
top: 50,
},
scale: {
minorTickInterval: 0.5,
tickInterval: 1,
label: {
customizeText() {
return `${this.valueText} s`;
},
},
},
sliderMarker: {
visible: false,
},
background: {
color: '#808080',
},
dataSource: [{ x: 0, y: 15 },
{ x: 1, y: -1 },
{ x: 2, y: 10 },
{ x: 3, y: -3 },
{ x: 4, y: 16 },
{ x: 5, y: 0 },
{ x: 6, y: 9 },
{ x: 7, y: 3 },
{ x: 8, y: 15 },
{ x: 9, y: -1 },
{ x: 10, y: 10 },
{ x: 11, y: -3 },
{ x: 12, y: 16 },
{ x: 13, y: 0 },
{ x: 14, y: 9 },
{ x: 15, y: 3 },
{ x: 16, y: 13 }],
chart: {
series: {
color: '#ffa500',
width: 3,
type: 'line',
argumentField: 'x',
valueField: 'y',
},
topIndent: 0.05,
bottomIndent: 0.05,
},
value: [0, 5],
title: 'Select a Range in the CPU Usage History',
});
});
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DevExtreme Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script>
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/23.1.5/css/dx.light.css" />
<script src="https://cdn3.devexpress.com/jslib/23.1.5/js/dx.all.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script src="index.js"></script>
</head>
<body class="dx-viewport">
<div class="demo-container">
<div id="range-selector"></div>
</div>
</body>
</html>
#range-selector {
height: 270px;
}