Highcharts: Set y Axis Max and Min dynamically, and not at creation
HighchartsHighcharts Problem Overview
Short question : Is there a way to set min/max
in Highcharts AFTER the chart has been created. I am aware of intial setup like y: {min: 100,max: 200}
at the chart initialization but I want to change max/min later on dynamically.
Highcharts Solutions
Solution 1 - Highcharts
I guess setExtremes is the best way to go about it.
Syntax should be: chart.yAxis[0].setExtremes(100,300);
If one wants to just set minimum then chart.yAxis[0].setExtremes(100,null);
worked for me.
Solution 2 - Highcharts
we can also use update method
chart.yAxis[0].update({
max: 100
});
chart.xAxis[0].update({
max: 150
});
Solution 3 - Highcharts
Also you can use tickPositioner http://api.highcharts.com/highcharts#yAxis.tickPositioner to define min/max values and ticks between these values.