0
votes

I have certain requirement where I need to override the auto calculated values for Y axis in highcharts. For eg. enter image description here

Here, the gridlines plot area is equally divided into 100. I wanted to override this so that the negative plot area should be at a max of let's say 50 and the positive ones can remain the same. Even if I try the max, min, softMax, softMin, ceiling and floor properties, the result is the same. I was thinking of using a secondary axis but then there is only one data in the series which would render the second one useless. I don't think using setExtremes() will be helpful either. I'm hoping to avoid modifying the library itself to add a certain option but it'll be helpful if such an option already exists in highcharts. Any suggestions?

1

1 Answers

1
votes

Use tickPositions or tickPositioner property:

yAxis: {
  tickPositions: [-50, 0, 100, 200, 300, 400]
}

Live demo: http://jsfiddle.net/BlackLabel/6m4e8x0y/4883/

API Reference:

https://api.highcharts.com/highcharts/yAxis.tickPositions

https://api.highcharts.com/highcharts/yAxis.tickPositioner