spacing: Number/String

spacing property allows you to control the space occupied by Custom Break. Value can either be in pixels (number – ex: 5) or percent (string – ex: “4%”). Percent values are relative to corresponding Axis length.

Default: Automatically Calculated
Example: 5, 8, “3%”, “5%”

  • Pixel values are Numbers
  • Percent values are strings ex: “4%”
  • Percent values are relative to the minimum of plot area’s width or height.
  • spacing is limited to a maximum of “10%” of Axis length.

var  chart =  new  CanvasJS.Chart("chartContainer",
 axisX: {
    scaleBreaks: {
	customBreaks: [{
	    spacing: "2%",


Try it Yourself by Editing the Code below.

  Also See:    

In order to provide better support, we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.