option = {
backgroundColor: '#0A1934',
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
xAxis: {
type: 'category',
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
margin: 20,
},
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value',
show: false
},
series: [{
data: [221, 188, 150, 180, 98, 211, 120],
type: 'bar',
stack: 'one',
itemStyle: {
borderWidth: 10,
borderColor: '#0A1934',
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#2FCAFD',
},
{
offset: 1,
color: '#2450F0',
},
]),
barBorderRadius: 120
},
emphasis: {
itemStyle: {
borderColor: '#0A1934',
}
}
},
{
data: [120, 30, 150, 80, 70, 110, 130],
type: 'bar',
stack: 'one', //堆叠
barWidth: 40,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#FFE131',
},
{
offset: 1,
color: '#FFB200',
},
]),
itemStyle: {
borderWidth: 10, //两个柱形图之间的间距
borderColor: '#0A1934',
barBorderRadius: 120
},
emphasis: {
itemStyle: {
borderColor: '#0A1934',
}
}
},
{
data: [120, 30, 150, 80, 70, 110, 130],
type: 'bar',
stack: 'one', //堆叠
barWidth: 40,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#6DFF6D',
},
{
offset: 1,
color: '#00DB00',
},
]),
itemStyle: {
borderWidth: 10, //两个柱形图之间的间距
borderColor: '#0A1934',
barBorderRadius: 120
},
emphasis: {
itemStyle: {
borderColor: '#0A1934',
}
}
}
]
};