Chartjs-How to separete chart series into different pane (Chart.js)

1πŸ‘

βœ…

I connected the y axis, used β€˜stack’, I turned off the position on the left and right

Example code

 options: {
  maintainAspectRatio: false,
  scales: {
    x: {
      ticks: {
        minRotation: 90,
        maxRotation: 90
      }
    },
    y: {
      stack: 'chart',   // add stack
      //position: 'left',
      beginAtZero: true,
      title: {
        display: true,
        text: '$'
      }
    },
    y1: {
      stack: 'chart', // add stack
      offset: true, // add offset
      //position: 'right',
      beginAtZero: true,
      title: {
        display: true,
        text: 'Cubic Metre'
      },
      grid: {
        drawOnChartArea: false
      }
    }
  },

Leave a comment