bwagner
bwagner

Reputation: 1029

How to set Highcharts chart maximum yAxis value

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

Upvotes: 63

Views: 118094

Answers (3)

MANISH ZOPE
MANISH ZOPE

Reputation: 1201

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;

Upvotes: 5

Peter
Peter

Reputation: 1166

Try this:

yAxis: {min: 0, max: 100}

See this jsfiddle example

Upvotes: 115

Gayan Dasanayake
Gayan Dasanayake

Reputation: 2021

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);

Upvotes: 10

Related Questions