Your search did not match any results.

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.

Backend API
@(Html.DevExtreme().Chart() .ID("chart") .Title("Relative Masses of the Heaviest\n Solar System Objects") .Legend(l => l.Visible(false)) .Series(s => s .Add() .Type(SeriesType.Bar) .ValueField("Mass") .ArgumentField("Name") ) .ValueAxis(v => v .Add() .Visible(true) .AutoBreaksEnabled(true) .MaxAutoBreakCount(3) .BreakStyle(b => b.Line(ScaleBreakLineStyle.Waved)) ) .DataSource(new[] { new { Name = "Jupiter", Mass = 318.0 }, new { Name = "Saturn", Mass = 95.0 }, new { Name = "Uranus", Mass = 14.6 }, new { Name = "Neptune", Mass = 17.2 }, new { Name = "Earth", Mass = 1.0 }, new { Name = "Venus", Mass = 0.82 }, new { Name = "Mars", Mass = 0.11 }, new { Name = "Mercury", Mass = 0.06 } }) ) <div class="options"> <div class="caption">Options</div> <div class="options-container"> <div class="option"> @(Html.DevExtreme().CheckBox() .Text("Enable Breaks") .ElementAttr("class", "checkbox") .Value(true) .OnValueChanged(@<text> function(data) { var chart = $("#chart").dxChart("instance"); chart.option("valueAxis[0].autoBreaksEnabled", data.value); } </text>) ) </div> <div class="option"> <span>Max Count</span> @(Html.DevExtreme().SelectBox() .DataSource(new[] { 1, 2, 3, 4 }) .Value(3) .Width(80) .InputAttr("aria-label", "Break Count") .OnValueChanged(@<text> function(data) { var chart = $("#chart").dxChart("instance"); chart.option("valueAxis[0].maxAutoBreakCount", data.value); } </text>) ) </div> <div class="option"> <span>Style</span> @(Html.DevExtreme().SelectBox() .DataSource(new[] { ScaleBreakLineStyle.Waved, ScaleBreakLineStyle.Straight }) .Value(ScaleBreakLineStyle.Waved) .Width(120) .InputAttr("aria-label", "Line Style") .OnValueChanged(@<text> function(data) { var chart = $("#chart").dxChart("instance"); chart.option("valueAxis[0].breakStyle.line", data.value); } </text>) ) </div> </div> </div>
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.MVC.Demos.Models.SampleData; using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ChartsController : Controller { public ActionResult ScaleBreaks() { return View(); } } }
#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; }

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.