Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highcharts: Set y Axis Max and Min dynamically, and not at creation

Tags:

highcharts

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.

like image 227
user1517108 Avatar asked Mar 03 '13 09:03

user1517108


2 Answers

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.

like image 138
user1517108 Avatar answered Oct 16 '22 16:10

user1517108


we can also use update method

chart.yAxis[0].update({
    max: 100
}); 

chart.xAxis[0].update({
    max: 150
}); 
like image 29
user1653907 Avatar answered Oct 16 '22 17:10

user1653907