When visualizing discrete data, it's usually desirable to show integer values on the yAxis of the chart. The best way to do this is to set yAxis.minStep to 1. This ensures that fractional increments will not be used, while still allowing larger increments if necessary. To format the y values in the tooltips, set a converter on valueFormats.y.converter.





With minStep = 1:



Here are some other options that I've seen, along with why they don't behave as well as minStep:


step: This forces the increment to the specified value, preventing larger increments from being used. This causes UX issues for charts with larger values (if the largest value is 20 for example) and performance issues for charts with much larger values (largest value > 1000), since many more grid lines than desired will be drawn.


tickLabel.converter: This is a popular option when a user is trying to get rid of ".0" decimal places in the axis labels. This approach fails because it doesn't change where tick labels are shown, just how they're formatted. This means that an axis with 0.0, 0.5, 1.0 will become 0, 1, 1.