medBouz
Posts: 1
Joined: Wed Jun 29, 2022 3:21 pm

problem in ceiling with allowDecimals

Example 1:

Highcharts.chart('container', {
title: {
text: 'Y axis floor is 0'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug']
},
yAxis: {
ceiling: 2,
allowDecimals:false,
},
series: [{
data: [10,25,25,35,55,85,55,54]
}]
});

In this example, i have a ceiling value at 2 and and values in my data array are greater than the ceiling value.
with the allowDecimal:false, i have a script error, when i delete the allowDecimals it works just fine.
I don't know if i am doing something wrong here, but i can't find an explanation for this issue.


Example 2:

Highcharts.chart('container', {
title: {
text: 'Y axis floor is 0'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug']
},
yAxis: {
ceiling: 2,
allowDecimals:false,
},
series: [{
data: [3,25,25,35,55,85,55,54]
}]
});

the first value in my data array is greater than the ceieling, yet i don't have a script error in this case, with a ceiling of 2 i can go till a value of 5 in my array.
Any value geater than 5 i have a script error again.



Thank you for your answers.
Best regards.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: problem in ceiling with allowDecimals

Hello medBouz!
Welcome to our forum and thanks for contacting us with your question!

Well, it looks like a bug, I need some more time to check it deeper. As a workaround, for now, I suggest you set a yAxis.min to e.g. 0 or other value, it will solve your problem for now. You can see it in the demo below.

Demo: https://jsfiddle.net/BlackLabel/zd1tLumg/

Feel free to ask any further questions.
Kind regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”