我正在使用叠条高图。当所有数据为零时,它显示挂0,但当其中至少有一个具有适当的值时,它显示0粘在y轴上。我希望这也适用于整个数据为0时请参考 http://jsfiddle.net/rutup/6hxPU/8/
function createBarChart(source, title, placeHolderId, sideText, xColumnValue) {
$('#' + placeHolderId).highcharts({
credits: { enabled: false },
chart: {
type: 'column'
},
exporting: { enabled: false },
title: {
text: false
},
xAxis: {
categories: xColumnValue
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
y:20,
borderWidth: 0
},
yAxis: {
min: 0,
//type: 'logarithmic',
//tickInterval:
lineWidth: 0,
gridLineWidth: 0,
title: {
text: sideText
},
labels: {
enabled: false
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: 'gray'
}
, formatter: function () {
return calcTotalAntiLog2(this);
}
}
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + calcAntiLog(this.y) //+ '<br/>' +//calcAntiLog(this.y)
// 'Total: ' + calcAntiLog(this.point.stackTotal);//calcAntiLog(this.point.stackTotal)
}
},
plotOptions: {
column: {
stacking: 'normal',
dataLabels: {
color: 'white',
enabled: true,
formatter: function () {
return calcAntiLog(this.y);
}
}
}
},
series: source
});
}