score:1

Accepted answer

to achieve this you will need to know the max value of your first chart. if you know this you can set the the suggestedmax value in the ticks options for the yaxes to that value.

var options = {
  type: 'bar',
  data: {
    labels: ["red"],
    datasets: [{
      label: '# of votes',
      data: [2],
      borderwidth: 1,
    }]
  },
  options: {
    scales: {
      yaxes: [{
        ticks: {
          suggestedmax: 25
        }
      }]
    }
  }
}

var ctx = document.getelementbyid('chartjscontainer').getcontext('2d');
new chart(ctx, options);
<body>
  <canvas id="chartjscontainer" width="600" height="400"></canvas>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/2.9.4/chart.js" integrity="sha512-hzf9qhp3rldjbvakvmig+goaakrza6lkuo35ok6esm0/kjpk32yw7urqrq3q+nvbbt8usss+iekl7crn83dymw==" crossorigin="anonymous"></script>
</body>


Related Query

More Query from same tag