我正在使用 highcharts 来呈现柱形图。由于它是分组堆叠柱形图,目前我得到的图例名称重复,正如您在小提琴中看到的那样:
我试图只呈现传说中唯一的名字;就我而言:
john fem
我基本上是想一起支持所有的传奇(约翰=>蓝柱系列+绿色+紫色)
代码:
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Total fruit consumtion, grouped by gender'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: {
allowDecimals: false,
min: 0,
title: {
text: 'Number of fruits'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +'</b><br/>'+
this.series.name +': '+ this.y +'<br/>'+
'Total: '+ this.point.stackTotal;
}
},
plotOptions: {
bar: {
stacking: 'normal'
}
},
series: [{
name: "Confirmed",
stack: "ACTIVE",
data: [4740, 1378, 8]
}, {
data: [2932, 141],
name: "Potential",
stack: "ACTIVE"
}, {
data: [1752, 11],
name: "Confirmed",
stack: "REOPENED"
},{
data: [1089, 2],
name: "Potential",
stack: "REOPENED"
},{
data: [2332, 1960, 42],
name: "Potential",
stack: "NEW"
},{
data:[480, 4684, 2258],
name: "Confirmed",
stack: "NEW"
}]
});
});
这可能吗
慕桂英4014372
相关分类