Reputation: 1695
I write a demo for my project,it works all right except Y-Axis does not adapt my data.It shows 100 max all the time,I searched on Internet that It should be self-adapted,but it doesn't.Anyone can help me would be appreciated,here is my code:
$(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'
}
},
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]
} ]
});
});
Upvotes: 1
Views: 77
Reputation: 19093
You have asked for 'percent' stacking, which makes each column add up to 100. I think you may want 'normal' stacking
Change:
plotOptions : {
column : {
stacking : 'percent'
}
},
to
plotOptions : {
column : {
stacking : 'normal'
}
},
http://api.highcharts.com/highcharts#plotOptions.column.stacking
Upvotes: 2