我为我的项目写了一个demo,它工作正常,除了Y轴不适应我的数据。它一直显示100 max,我在网上搜索它应该是自适应的,但它没有.任何人都可以帮助我,我将不胜感激,这是我的代码:
$(function () {
$('#container').highcharts({
chart : {
type : 'column'
},
title : {
text : 'IP subnet statics'
},
xAxis : {
categories : [ 'subnnet1', 'subnet2', 'subnet3' ]
//categories : result.subnets
},
yAxis : {
min : 0,
title : {
text : 'total IP'
}<br/>
},
tooltip : {
pointFormat : '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.percentage:.0f}%)<br/>',
shared : true
},
plotOptions : {
column : {
stacking : 'percent'
}
},
series : [ {
name : 'free',
data : [22,33,55]
}, {
name : 'occupy',
data : [11,22,33]
} ]
});
});
最佳答案
您要求“百分比”堆叠,这使得每列加起来为 100。我认为您可能需要“正常”堆叠
改变:
plotOptions : {
column : {
stacking : 'percent'
}
},
到
plotOptions : {
column : {
stacking : 'normal'
}
},
http://api.highcharts.com/highcharts#plotOptions.column.stacking
关于javascript - Highcharts yAxis自适应问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24901107/