I'm having an issue with highcharts where I have a number of different charts being generated by JSON calls.
For the majority of these charts I need the minimum y-axis value to be set at 0, however there are a couple of occasions where negative values need to be shown. How can I tell highcharts to have a minimum y-axis value of 0 only if there are no negative values in the data, is this even possible?
Thanks
The option that you're looking for is called softMin
and was introduced in version 5.0.1. The docs describe it as follows:
A soft minimum for the axis. If the series data minimum is greater than this, the axis will stay at this minimum, but if the series data minimum is lower, the axis will flex to show all data.
yAxis: {
softMin: 0
}