Your search did not match any results.
Bar Charts

Scale Breaks

Scale breaks (wavy stripes you see on the chart) cut out ranges from the value axis. This technique may enhance chart readability if values differ greatly. As you can see in this demo, you can easily compare smaller values if scale breaks are enabled. If you disable scale breaks, the smaller values are indistinguishable.

The Chart component can generate scale breaks on the valueAxis. The Chart detects large gaps between side-by-side points, cuts them out, and displays scale breaks instead. Scale breaks are available only for 'continuous' or 'logarithmic' axis types.

To enable auto-calculated scale breaks, set the autoBreaksEnabled property to true. Use the maxAutoBreakCount property to limit the number of automatically created scale breaks. To configure scale break appearance, use the breakStyle object. You can test all these options in the demo.

You can also create custom breaks, including breaks on the argumentAxis. Use the breaks array to declare a scale break collection. Each object in this array must specify the startValue and endValue fields that limit a single scale break. Note that breaks smaller than two ticks might not appear on the chart.

Backend API
Copy to CodePen
const DemoApp = angular.module('DemoApp', ['dx']); DemoApp.controller('DemoController', ($scope) => { $scope.lineStyleValue = lineStyles[0]; $scope.breaksCountValue = breaksCount[2]; $scope.autoBreaksEnabledValue = true; $scope.chartOptions = { dataSource, series: { type: 'bar', valueField: 'mass', argumentField: 'name', }, bindingOptions: { 'valueAxis.autoBreaksEnabled': 'autoBreaksEnabledValue', 'valueAxis.maxAutoBreakCount': 'breaksCountValue', 'valueAxis.breakStyle.line': 'lineStyleValue', }, valueAxis: { visible: true, }, title: 'Relative Masses of the Heaviest\n Solar System Objects', legend: { visible: false, }, tooltip: { enabled: true, }, }; $scope.breaksCheckBoxOptions = { text: 'Enable Breaks', bindingOptions: { value: 'autoBreaksEnabledValue', }, }; $scope.maxCountSelectBoxOptions = { items: breaksCount, width: 80, bindingOptions: { value: 'breaksCountValue', }, }; $scope.lineStyleSelectBoxOptions = { items: lineStyles, width: 120, bindingOptions: { value: 'lineStyleValue', }, }; });
<!DOCTYPE html> <html xmlns=""> <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=""></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="" /> <link rel="stylesheet" type="text/css" href="" /> <script src=""></script> <script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C/script%3E'))</script> <script src=""></script> <script src="data.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 id="chart" dx-chart="chartOptions"></div> <div class="options"> <div class="caption">Options</div> <div class="options-container"> <div class="option"> <div class="checkbox" dx-check-box="breaksCheckBoxOptions"></div> </div> <div class="option"> <span>Max Count</span> <div dx-select-box="maxCountSelectBoxOptions"></div> </div> <div class="option"> <span>Style</span> <div dx-select-box="lineStyleSelectBoxOptions"></div> </div> </div> </div> </div> </body> </html>
#chart { height: 440px; } .options { padding: 20px; background-color: rgba(191, 191, 191, 0.15); margin-top: 20px; } .caption { font-size: 18px; font-weight: 500; } .option { display: inline-block; margin-right: 70px; margin-top: 5px; } .option > span { margin: 0 10px 0 0; } .checkbox { margin-top: -4px; } .option > .dx-widget { display: inline-block; vertical-align: middle; } .options-container { display: flex; align-items: center; }
const dataSource = [{ name: 'Jupiter', mass: 318, }, { name: 'Saturn', mass: 95, }, { name: 'Uranus', mass: 14.6, }, { name: 'Neptune', mass: 17.2, }, { name: 'Earth', mass: 1, }, { name: 'Venus', mass: 0.82, }, { name: 'Mars', mass: 0.11, }, { name: 'Mercury', mass: 0.06, }]; const lineStyles = ['waved', 'straight']; const breaksCount = [1, 2, 3, 4];