How to set Highcharts chart maximum yAxis value

JavascriptHighcharts

Javascript Problem Overview


I've been trying for two days to find a way to set the maximum value of the yAxis on Highcharts.

I got a percentage column graphic, but the highest value in the series is 60, so it adjusts the axis to top at 70, I found a way to choose the start point, but no way to choose the end point.

What I really need is to set the yAxis from 0 to 100, so the data will be more accurately viewed as percentage

Thanks in advance, Bruno W.G.

Javascript Solutions


Solution 1 - Javascript

Try this:

yAxis: {min: 0,	max: 100}

See this jsfiddle example

Solution 2 - Javascript

Alternatively one can use the setExtremes method also,

yAxis.setExtremes(0, 100);

Or if only one value is needed to be set, just leave other as null

yAxis.setExtremes(null, 100);

Solution 3 - Javascript

Taking help from above answer link mentioned in the above answer sets the max value with option

yAxis: { max: 100 },

On similar line min value can be set.So if you want to set min-max value then

yAxis: {
   min: 0,     
   max: 100
},

If you are using HighRoller php library for integration if Highchart graphs then you just need to set the option

$series->yAxis->min=0;
$series->yAxis->max=100;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionbwagnerView Question on Stackoverflow
Solution 1 - JavascriptPeterView Answer on Stackoverflow
Solution 2 - JavascriptGayan DasanayakeView Answer on Stackoverflow
Solution 3 - JavascriptMANISH ZOPEView Answer on Stackoverflow