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 }
http://api.highcharts.com/highcharts/yAxis.softMin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With