Every time I set my min and max values in Highcharts, I never get graphs with the exact min and max that I sent, but always something somewhat close. It seems as though Highcharts is picking a interval range for the axes and if my maximum doesn't conform to the right interval, it gets ignored or rounded off.
For example, if I set a min of 0 and a max of 3125 for a Y axis, I get a Y axis starting with 0 then going up in increments of 500 to a maximum of 3500, which is not at all what I want.
Can I get the chart to use an exact maximum or will it always round up in some wierd way?
There are a couple of things that you can do.
1) set your tickInterval to a number that divides evenly into your max
2) set 'endOnTick' to false for your y axis, and set your maxPadding to 0. This will set the chart max to your specification, regardless of where the last tick falls.
http://api.highcharts.com/highcharts#yAxis.tickInterval
http://api.highcharts.com/highcharts#yAxis.maxPadding
http://api.highcharts.com/highcharts#yAxis.endOnTick
Set the endOnTick property to false.
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