您好,在堆叠的分组柱形图中,如何为两个堆栈拥有一个系列的值?我想要实现的是按客户分组堆栈,这很简单。但就我而言,我对两个堆栈都有不同商品的价值。我创建了以下 jsfiddle 示例,它更好地解释了这个问题。 链接到代码
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Stacked Grouped'
},
xAxis: {
categories: ['Customer1', 'Customer2']
},
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Count'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +'</b><br/>'+
this.series.name +': '+ this.y +'<br/>'+
'Total: '+ this.point.stackTotal;
}
},
plotOptions: {
column: {
stacking: 'normal'
},
bar: {
dataLabels: {
enabled: true
}
}
},
series: [{
name: 'Iron Ore',
data: [5, 3],
stack: 'today',
}, {
name: 'Manetite',
data: [3, 4],
stack: 'yesterday'
},
{
name: 'Iron Ore',
data: [5, 3],
stack: 'today'
}, {
name: 'Manetite',
data: [3, 4],
stack: 'yesterday'
}]
});
});
如您所见,商品以这种方式翻了一番,但我希望它们在两个堆栈上。
任何帮助深表感谢。谢谢!