每一列的颜色都是固定的 可以变成不同颜色吗 或者可以改变前后顺序吗(比如有的蓝色在红色的前面)
配置项如下
app.title = '堆叠条形图';
option = {
tooltip : {
trigger: 'axis',
axisPointer : { // 坐标轴指示器,坐标轴触发有效
type :'shadow' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: ['直接访问', '邮件营销','联盟广告','视频广告','搜索引擎']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: ['A1','A2','B','C1','C2','D1','D2','D3','E1','E2']
},
series: [
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [40, 40, 35, 39, 40, 46, 43,45,39,45]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [20, 38, 35, 40, 39, 14, 27,45,28,28]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [40, 40, 35, 11, 39, 22, 35,9,28,56]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [38, 40, 33, 39, 37, 26, 23,56,28,28]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [38, 0, 35, 9, 3, 45, 43,43,27,28]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [0, 0, 3, 37, 39, 34, 45,43,28,27]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [0, 0, 33, 0, 0, 45, 0,0,28,27]
},
{
name: '',
type: 'bar',
stack: '总量',
label: {
normal: {
show: false,
position: 'insideRight'
}
},
data: [0, 0, 0,0, 0, 0, 0,0,27,0]
}
]
};