Your search did not match any results.
Range Selector

Logarithmic Scale

Documentation

In this demo, a logarithmic axis is used to select a range within a set of rapidly-growing values.

Backend API
Copy to CodePen
Apply
Reset
const DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', ($scope) => { const dataSource = []; const max = 100; for (let i = 0; i < max; i += 1) { dataSource.push({ arg: 10 ** i * 0.1, val: Math.log(i + 1) / Math.log(0.5) + (Math.random() - 0.5) * (100 / (i + 1)) + 10, }); } $scope.chartOptions = { dataSource, resizePanesOnZoom: true, argumentAxis: { valueMarginsEnabled: false, type: 'logarithmic', label: { format: 'exponential' }, grid: { visible: true, }, minorGrid: { visible: true, }, minorTickCount: 10, }, legend: { visible: false, }, series: {}, }; $scope.rangeSelectorOptions = { dataSource, chart: { series: {}, }, scale: { type: 'logarithmic', label: { format: 'exponential' }, minRange: 1, minorTickCount: 10, }, sliderMarker: { format: 'exponential', }, behavior: { callValueChanged: 'onMoving', snapToTicks: false, }, onValueChanged(e) { $('#zoomed-chart').dxChart('instance').getArgumentAxis().visualRange(e.value); }, }; });
<!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/21.2.4/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/21.2.4/css/dx.light.css" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C/script%3E'))</script> <script src="https://cdn3.devexpress.com/jslib/21.2.4/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" ng-app="DemoApp" ng-controller="DemoController"> <div> <div id="zoomed-chart" dx-chart="chartOptions"></div> <div id="range-selector" dx-range-selector="rangeSelectorOptions"></div> </div> </div> </body> </html>
#zoomed-chart { height: 335px; margin: 0 0 15px; } #range-selector { height: 120px; }