• Demos
    • JavaScript Charts
    • JavaScript StockCharts
  • Download
    • Download Chart
    • Download StockChart
  • Integrations
    • Front End Technology Samples
      • React Charts
      • Angular Charts
      • Vue.js Charts New!
      • jQuery Charts
      • Dashboards
    • Server Side Technology Samples
      • PHP Charts
      • Python Charts New!
      • ASP.NET MVC Charts
      • Spring MVC Charts
      • JSP Charts
  • License
  • Blog
  • Docs
    • Chart Documentation
    • StockChart Documentation
  • Support Forum
    • Chart Support
    • StockChart Support
  • My Account
  • My Account
  • KEY FEATURES
    • Chart with Index Label
    • Multi Series Chart
    • Chart with Zooming & Panning
    • Synchronized Charts
    • Chart with Animation
    • Chart With Image Overlay
    • Chart with Secondary Axis
    • Chart with Null Data
    • Chart with Dynamic Data
    • Column Chart with Reversed Axis
    • Chart with Logarithmic Axis
    • Chart using JSON Data
    • Performance With 50,000 Data Points
    • Draggable Column Chart
    • Chart with Axis / Scale Break
    • Chart with Crosshair
    • Chart with Customized Legends
    • Drilldown Chart
    • Responsive Chart
    • Chart with Axis Labels & Ticks inside Plot Area
    • Sync ToolTip across Multiple Charts
  • LINE CHARTS
    • Line Chart
    • Dashed Line Chart
    • Multi Series Line Chart
    • Line Chart with Zoom and Pan
    • Line Chart with Data Marker
    • Line Chart with Logarithmic Axis
    • Line Chart with Axis / Scale Break
    • Line Chart with Multiple Axes
    • Spline Chart
    • Multi Series Spline Chart
    • Dynamic Spline Chart
    • Spline Chart with Secondary Axis
    • Spline Chart with Legends
    • Step Line Chart
    • Multi Series Step Line Chart with Null Data
  • AREA CHARTS
    • Area Chart
    • Multi Series Area Charts
    • Spline Area Chart
    • Multi Series Spline Area Charts
    • Step Area Chart
    • Range Area Chart
    • Multi Series Range Area Charts
    • Range Spline Area Chart
    • Stacked Area Chart
    • Stacked Area 100% Chart
    • Stacked Area 100% Chart with Date-Time Axis
  • COLUMN & BAR CHARTS
    • Column Chart
    • Column Charts with Multiple Axes
    • Bar Chart
    • Multi Series Bar Chart
    • Bar Chart with Axis / Scale Break
    • Range Column Chart
    • Multi Series Range Column Chart
    • Stacked Column Chart
    • Stacked Column 100% Chart
    • Range Bar Chart
    • Stacked Bar Chart
    • Stacked Bar 100% Chart
    • Waterfall Chart
    • Multi Series Waterfall Chart
    • Waterfall Chart with Custom Colors
  • PIE & FUNNEL CHARTS
    • Pie Chart
    • Pie Chart with Legends
    • Pie Chart with Custom Radius
    • Doughnut Chart
    • Doughnut Chart with Custom Inner Radius
    • Funnel Chart
    • Funnel Chart with Custom Neck
    • Inverted Funnel Chart
    • Pyramid Chart
    • Pyramid Chart with Values represented by Area
    • Pyramid Chart With Index Labels Placed Inside
  • FINANCIAL CHARTS
    • Candlestick Chart
    • Multi Series Candlestick Chart
    • Combination of Candlestick & Line Chart
    • OHLC Chart
    • OHLC Chart from JSON Data using AJAX
  • SCATTER & BUBBLE CHARTS
    • Scatter / Point Chart
    • Multi Series Scatter / Point Chart
    • Scatter Chart with Custom Markers
    • Bubble Chart
    • Bubble Chart with Zoom & Pan
    • Bubble Chart with Custom Markers
  • BOX & WHISKER CHARTS
    • Box And Whisker Chart
    • Box and Whisker Chart with Color Customization
    • Box And Whisker Chart with Outliers
  • COMBINATION CHARTS
    • Error Chart
    • Error Line Chart
    • Error Bar Chart
    • Pareto Chart
    • Pareto Chart with Index / Data Label
    • Combination of Range Area and Line Charts
    • Combination of Column, Line and Area Chart
    • Combination of OHLC and Line Chart
  • DYNAMIC CHARTS
    • Dynamic / Live Column Chart
    • Dynamic / Live Line Chart
    • Dynamic / Live Multi Series Chart
  • ANGULAR, REACT, VUE.JS, JQUERY
    • Angular Charts
    • React Charts
    • Vue.js Charts
    • jQuery Charts
  • SERVER SIDE TECHNOLOGIES
    • ASP.NET MVC Charts
    • PHP Charts
    • Python Charts
    • JSP Charts
    • Spring MVC Charts

JavaScript Line Charts with Axis / Scale Breaks

Download JavaScript Chart Samples
  • JavaScript Chart Samples
  • React Chart Samples
  • Angular Chart Samples
  • Vue.js Chart Samples
  • jQuery Chart Samples
  • PHP Chart Samples
  • Python Django Chart Samples
  • ASP.NET Chart Samples
  • JSP Chart Samples
  • Spring MVC Chart Samples
  • Dashboard Samples
  • JavaScript StockChart Samples

Scale / Axis Break can be very useful to display two distinct ranges in the same chart area. Line chart supports scale / axis breaks on both axes like any other CanvasJS Graph. Given example shows Line Chart with axis break. It also contains source code that you can edit in-browser or save to run locally.

Try Editing The Code

window.onload = function () {

var chart = new CanvasJS.Chart("chartContainer", {
	animationEnabled: true,
	title:{
		text: "Website Traffic"
	},
	axisX:{
		valueFormatString: "DD MMM"
	},
	axisY: {
		title: "Number of Visitors",
		scaleBreaks: {
			autoCalculate: true
		}
	},
	data: [{
		type: "line",
		xValueFormatString: "DD MMM",
		color: "#F08080",
		dataPoints: [
			{ x: new Date(2017, 0, 1), y: 610 },
			{ x: new Date(2017, 0, 2), y: 680 },
			{ x: new Date(2017, 0, 3), y: 690 },
			{ x: new Date(2017, 0, 4), y: 700 },
			{ x: new Date(2017, 0, 5), y: 710 },
			{ x: new Date(2017, 0, 6), y: 658 },
			{ x: new Date(2017, 0, 7), y: 734 },
			{ x: new Date(2017, 0, 8), y: 963 },
			{ x: new Date(2017, 0, 9), y: 847 },
			{ x: new Date(2017, 0, 10), y: 853 },
			{ x: new Date(2017, 0, 11), y: 869 },
			{ x: new Date(2017, 0, 12), y: 943 },
			{ x: new Date(2017, 0, 13), y: 970 },
			{ x: new Date(2017, 0, 14), y: 869 },
			{ x: new Date(2017, 0, 15), y: 890 },
			{ x: new Date(2017, 0, 16), y: 930 },
			{ x: new Date(2017, 0, 17), y: 1850 },
			{ x: new Date(2017, 0, 18), y: 1905 },
			{ x: new Date(2017, 0, 19), y: 1980 },
			{ x: new Date(2017, 0, 20), y: 1858 },
			{ x: new Date(2017, 0, 21), y: 1034 },
			{ x: new Date(2017, 0, 22), y: 963 },
			{ x: new Date(2017, 0, 23), y: 847 },
			{ x: new Date(2017, 0, 24), y: 853 },
			{ x: new Date(2017, 0, 25), y: 869 },
			{ x: new Date(2017, 0, 26), y: 943 },
			{ x: new Date(2017, 0, 27), y: 970 },
			{ x: new Date(2017, 0, 28), y: 869 },
			{ x: new Date(2017, 0, 29), y: 890 },
			{ x: new Date(2017, 0, 30), y: 930 },
			{ x: new Date(2017, 0, 31), y: 750 }
		]
	}]
});
chart.render();

}                            

Chart Customizations

You can customize the way breaks are represented in chart using type property. Other commonly used customization options are lineThickness, startValue, endValue, spacing, collapsibleThreshold etc.

© fenopix
  • About Us
  • FAQs
  • Careers
  • Privacy Policy
Server Side Technologies
  • ASP.NET MVC Charts
  • PHP Charts
  • JSP Charts
  • Spring MVC Charts
Front End Technologies
  • JavaScript Charts
  • jQuery Charts
  • React Charts
  • Angular Charts
  • JavaScript StockCharts
Contact
  • Fenopix, Inc.
  • 2093 Philadelphia Pike,
  • #5678, Claymont,
  • Delaware 19703
  • United States Of America