开发者

How to set Highcharts chart maximum yAxis value

开发者 https://www.devze.com 2023-03-23 02:24 出处:网络
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 t

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 t开发者_StackOverflow中文版o 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


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

精彩评论

暂无评论...
验证码 换一张
取 消