Answers for "chartjs start at 0"

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
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