Highchart: can I make sure the y-axis values are integers?
1 answer
Try to remove all values in xAxis or use the following code.
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
labels: {
enabled: false
}
}
See example http://jsfiddle.net/ssgoanb5/
See doc: http://api.highcharts.com/highcharts#xAxis.labels.enabled
New updates:
To avoid decimal places in the Axis (x / y) plot, add the allowDecimals attributes.
See Doc. http://api.highcharts.com/highcharts#yAxis.allowDecimals
yAxis: {
allowDecimals: false,
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
}
Check out the updated JSfiddle: http://jsfiddle.net/ssgoanb5/6/
+6
source to share