Home › forums › Report Bugs › Issue with negative minimum value on y axis
when using 2 y-axis there seems to be a bug with the automatic calculation of the minimum value when null values are present. In the example on jsfiddle there are only positive values on both y axis, but the first y axis start with a negative value, what is obviously caused by a null value. The automatic calculation should ignore null values instead of starting with a negative minimum value that doesn’t exist. Can you please check and fix this issue?
It seems to be working properly irrespective of the presence of null dataPoints. Please take a look at this updated JSFiddle which has dataPoints without null data.
The auto-calculated range of axisY depends on multiple factors which includes y-values of entire dataSeries. In the JSFiddle that you have shared, the minimum and maximum y-values of both the dataSeries are different. Because of the different range of y-values passed in dataSeries, one axis has a negative minimum and the other doesn’t.
Thank you for your reply. I checked your updated JSFiddle and I see it is not the null value causing a negative minimum what makes it even more strange. It is misleading when negative values present on one of the y axis, because it creates an illusion of negative values being in the chart. Can you fix the auto calculation in a way that it does not start with a negative minimum when only positive values are present?
As mentioned earlier, the range of an axis depends on multiple factors like dataSeries attached to it, range of the dataPoints of a given dataSeries, etc. Based on the JSFiddle shared by you the minimum y value in the first series is 0.04, in such cases dataPoints goes out of viewport making it difficult to visualize because of which the auto-calculated range has a negative minimum. This feature is by design.
However, you can customize the range of axisY by setting values of minimum and maximum properties. Please take a look at the respective documentation pages for more information and live example.
You must be logged in to reply to this topic.