the link has pretty up to date information. the keey is to recognise what the chart object is. :) i struggled for half a day reading various pages until i found the right way

  1. use the basechartdirective to access the chart directly by doing this -> this.chart
  2. to update scales do this:
 var barchartoptions =  {
      legend: { display: true },
      scales: { yaxes: [{ id: 'yaxis', type: 'linear', position: 'left', ticks: { min: 0, max: maxscale } }]}  };  
 this.chart.chart.options = barchartoptions;
  1. then update the chart:


you can pretty much update everything. just need to realise what the chart object means in this page: :)


this is my solution for line chart.

you can use 'beforefit' callback function that you can find here in the docs

  1. in you have the chart dataset
  2. you must set the scale.options.ticks.max


scales: {
        yaxes: [{
          beforefit: function (scale) {

            // see what you can set in scale parameter

            // find max value in your dataset
            let maxvalue = 0
            if (scale.chart.config && && {
     => {
                if (dataset && {
         => {
                    if (value > maxvalue) {
                      maxvalue = value

            // after, set max option !!!
            scale.options.ticks.max = maxvalue

i hope i've been helpful.


found the solution myself.

to change any options of the chart:


in my case

mybar.config.options.scales.yaxes[0].ticks.max = newvalue

after this you have to call


Related Query

More Query from same tag