Search
 
SCRIPT & CODE EXAMPLE
 

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
            	}
        	}]
    	}
	}
})
Comment

chartjs begin at 0

options: {
    scales: {
        y: {
            beginAtZero: true
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: find max between 2 numbers javascript 
Javascript :: split the numbers js 
Javascript :: express request path 
Javascript :: datatables cdn file 
Javascript :: how to clean modal on js in event hide 
Javascript :: javascript sort array by A-Z in js 
Javascript :: jquery get image src 
Javascript :: get count of div by class 
Javascript :: ion button transparent 
Javascript :: drupal twig node alias 
Javascript :: regular expression not to allow space in javascript 
Javascript :: how to add comment in react js 
Javascript :: eslint allow debugger 
Javascript :: how to open link in new tab in react js 
Javascript :: add event listener to multiple element in JS 
Javascript :: jquery get element width 
Javascript :: javascript hashtable contains key 
Javascript :: js hide element by class 
Javascript :: jquery get attribute value of parent element 
Javascript :: array of objects sahould have unique values 
Javascript :: array reverse without mutating 
Javascript :: how to get current year in nodejs 
Javascript :: express get cookie 
Javascript :: electron specify minimum size 
Javascript :: change label value jquery 
Javascript :: js check file exist 
Javascript :: react image wont show 
Javascript :: avaScript slice() With Negative index 
Javascript :: how to get first and last name from email js regex 
Javascript :: js time difference in minutes 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =