Home Forums StockChart Support Set CustomBreaks for axis with a Date

Set CustomBreaks for axis with a Date

Viewing 2 posts - 1 through 2 (of 2 total)
  • #36076

    How would I set a custombreak on an axis that shows dates?

    #36090

    @fulsdavid,

    To add customBreaks in StockChart you can specify the startValue and endValue of the region to be shrunk on respective axis for each individual charts as shown in the code snippet below –

     var stockChart = new CanvasJS.StockChart("stockChartContainer", {
        title: {
          text:"StockChart with CustomBreaks"
        },
        .
        .
        charts: [{
          axisX: {
            scaleBreaks: {
              type: "straight",
              customBreaks: [{
                startValue: new Date(2007, 00, 01), 
                endValue: new Date(2010, 00, 01) 
              }]
            }
          },
          .
        }],
        .
        .
      });

    Please check this JSFiddle for a working example on adding customBreaks in StockChart.

    StockChart with customBreaks

    ___________
    Indranil Deo
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.