I have a temperature charting app that reads it's data from a JSON. When there is only 1 data point on a particular Y axis, the Y axis values are showing all the decimal places of the point, even though I explicitly asked for no decimal places. Any ideas, or is this a bug?
Fiddle: http://jsfiddle.net/e10u6sx1/
$(function () {
$('#container').highcharts({
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
yAxis: [{
tickInterval: 1,
allowDecimals: false,
startOnTick: true,
endOnTick: true
}, {opposite: true
}],
series: [{
data: [2.933] // when a second point is added, everything's fine!
}, {
yAxis: 1,
data: [1, 2, 3, 4]}
]
});
});
Simply set minRange
for axis, like this: http://jsfiddle.net/e10u6sx1/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With