Highcharts - delete decimal places along the Y axis with only one point

I have a temperature calculation application that reads data from JSON. When there is only one data point on a particular Y axis, the Y axis values ​​show all the decimal points of the point, although I have not explicitly specified decimals. Any ideas, or is this a mistake?

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 fine! }, { yAxis: 1, data: [1, 2, 3, 4]} ] }); }); 
+5
source share
1 answer

Just set minRange for the axis, for example: http://jsfiddle.net/e10u6sx1/1/

+3
source

Source: https://habr.com/ru/post/1204030/


All Articles