Chartjs-Break y axis in line chart chart.js

0👍

There is no build in way to do this. The best thing you can do is use a second Y axes and link the second dataset to the other axes.

datasets: [
        {
          label: '# of Votes',
          data: [12, 19, 3, 5, 2, 3],
        borderWidth: 1,
        yAxisID: 'first'
        },  
            {
                label: '# of Points',
                data: [7, 11, 5, 8, 3, 7],
                borderWidth: 1,
        yAxisID: 'second'
            }
        ]

options: {
    scales: {
        yAxes: [{
        id: 'first'
      },{
        id: 'second'
      }]
    }
  }

Leave a comment