简体   繁体   中英

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

Thanks in advance, Bruno WG

Try this:

yAxis: {min: 0, max: 100}

See this jsfiddle example

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

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM