const colorList = [
'#4f81bd',
'#c0504d',
'#4f81bd',
'#4f81bd',
'#4f81bd',
'#4f81bd'
];
option = {
title: {
text: 'Profit',
left: 'center'
},
tooltip: {},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
},
series: [
{
name: 'Direct',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [100, 100, 100, 100, 100, 100, 100],
barCategoryGap:'0%',
itemStyle: {
normal: {
color: function(params) {
// 给出颜色组
return colorList[params.dataIndex]
},
}
},
},
{
name: 'Mail Ad',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [100, 100, 100, 100, 100, 100, 100],
barCategoryGap:'0%',
itemStyle: {
normal: {
color: function(params) {
// 给出颜色组
return colorList[params.dataIndex]
},
}
},
},
{
name: 'Affiliate Ad',
type: 'bar',
stack: 'total',
label: {
show: true
},
emphasis: {
focus: 'series'
},
data: [100, 100, 100, 100, 100, 100, 100],
barCategoryGap:'0%',
itemStyle: {
normal: {
color: function(params) {
// 给出颜色组
return colorList[params.dataIndex]
},
}
},
}
]
};
echars连续堆叠柱状图
最新推荐文章于 2024-08-21 17:31:52 发布