Your search did not match any results.
Bar Charts

Scale Breaks

Documentation

Scale breaks allow breaking off parts of the axis to improve the readability of a chart with high amplitude values. This example demonstrates auto-calculated scale breaks. You can change the number of breaks, their style or disabled them.

Copy to CodePen
Apply
Reset
window.onload = function() { var lineStyleValue = ko.observable(lineStyles[0]), breaksCountValue = ko.observable(breaksCount[2]), autoBreaksEnabledValue = ko.observable(true), viewModel = { chartOptions: { dataSource: dataSource, series: { type: "bar", valueField: "mass", argumentField: "name" }, valueAxis: { visible: true, autoBreaksEnabled: autoBreaksEnabledValue, maxAutoBreakCount: breaksCountValue, breakStyle: { line: lineStyleValue } }, title: "Relative Masses of the Heaviest\n Solar System Objects", legend: { visible: false }, tooltip: { enabled: true } }, breaksCheckBoxOptions: { text: "Enable Breaks", value: autoBreaksEnabledValue }, maxCountSelectBoxOptions: { items: breaksCount, value: breaksCountValue, width: 60 }, lineStyleSelectBoxOptions: { items: lineStyles, value: lineStyleValue, width: 120 } }; ko.applyBindings(viewModel, document.getElementById("chart-demo")); };
<!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.1.0/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery-3.1.0.min.js"%3E%3C/script%3E'))</script> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.2.7/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/17.2.7/js/dx.all.js"></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"> <div id="chart" data-bind="dxChart: chartOptions"></div> <div class="options"> <div class="caption">Options</div> <div class="option"> <div class="checkbox" data-bind="dxCheckBox: breaksCheckBoxOptions"></div> </div> <div class="option center"> <span>Max Count</span> <div data-bind="dxSelectBox: maxCountSelectBoxOptions"></div> </div> <div class="option right"> <span>Style</span> <div data-bind="dxSelectBox: lineStyleSelectBoxOptions"></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; }
var 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, }]; var lineStyles = ["waved", "straight"]; var breaksCount = [1, 2, 3, 4];