Chartjs-Chart.js – access yAxes properties

1👍

Your options are defined in the Chart.js version 2 syntax.

scales.[x/y] axes arrays were removed in Chart.js version 3 (see specific changes). Scales are now configured directly to options.scales object with the object key being the scale id.

options: {
  scales: {
    y: {
      beginAtZero: false
    }     
  }    
}

It seems that your chart.options.scales are overwritten with default values by Chart.js because they don’t comply with the expected format. This would explain why chart.options.scales.yAxes returns an Object instead of an Array.

Leave a comment