Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
            	}
        	}]
    	}
	}
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #chartjs #start
ADD COMMENT
Topic
Name
2+3 =