Answers for "chart js bar chart yaxis from 1 to 100"

4

chart.js y axis maximum value

var options = {
    scales: {
        yAxes: [{
            display: true,
            ticks: {
                beginAtZero: true,   // minimum value will be 0.
              	// <=> //
              	min: 0,
              	max: 10,
              	stepSize: 1 // 1 - 2 - 3 ...
            }
        }]
    }
};
Posted by: Guest on December-22-2020
0

chartjs start at 0

// v3.0+
new Chart(ctx, {
  type: 'line',
  data: data,
  options: {
    scales: {
      y: {
        min: 0
      }
    }
  }
}

// v2.0
new Chart(ctx, {
	type: 'line',
    data: data,
    options: {
    	scales: {
        	yAxes: [{
            	ticks: {
                	beginAtZero: true
            	}
        	}]
    	}
	}
})
Posted by: Guest on October-14-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language