63

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

starball
  • 20,030
  • 7
  • 43
  • 238
bwagner
  • 1,029
  • 1
  • 11
  • 13

3 Answers3

114

Try this:

yAxis: {min: 0, max: 100}

See this jsfiddle example

Muhammad Usman
  • 10,426
  • 22
  • 72
  • 107
Peter
  • 1,156
  • 1
  • 8
  • 2
10

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);
Gayan Dasanayake
  • 1,933
  • 2
  • 17
  • 22
5

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;
Bora
  • 10,529
  • 5
  • 43
  • 73
MANISH ZOPE
  • 1,181
  • 1
  • 11
  • 28
  • 2
    I have a chart with max values of 13417. So I want to show max 15000. But the chart shows max of 20000. If I put `max: 10000 `it shows max 10000 but other values between 10-15000 always shows 20000. What am I doing wrong? Here is a demo [link](https://jsfiddle.net/asle/yhkrcque/14/) – Asle Nov 30 '15 at 11:00
  • @Asle I think you maybe found fix to your problem, but setting the tick interval will indeed fix it: https://jsfiddle.net/yhkrcque/24/ – MiChAeLoKGB Feb 18 '16 at 16:06
  • 1
    Yes @MiChAeLoKGB, it was the tick intervall that did the trick! – Asle Feb 19 '16 at 01:57