Chartjs-Chart.js min max not working, can not disable scaling as values change

0👍

This fixed it as I’m using Chart.js 4+

  options: {
    tooltips: {
      backgroundColor: "rgba(0, 0, 0, 0.8)",
      titleFontSize: 16,
      bodyFontSize: 14
    },
    maintainAspectRatio: false,
    scales: {
      x: {
        type: 'linear',
        position: 'bottom',
        suggestedMin: 21,
        suggestedMax: 37
      },
      y: {
        type: 'linear',
        position: 'bottom',
        suggestedMin: 520,
        suggestedMax: 780
      }
    }
  },

Leave a comment