设置stack后,两个bar并排显示,而不是堆叠显示~
来源:2-12 累计用户数组件开发1
菜卷_
2022-03-16

对比了好多次,写的没问题啊,但是为啥是并排显示的。。提问区的方法也没用啊~
chart.setOption({
xAxis: {
type: "value",
show: false,
},
yAxis: {
type: "category",
show: false,
},
series: [
{
type: "bar",
stack: "总量",
data: [200],
barWidth: 10,
},
{
type: "bar",
stack: "总量",
data: [250],
},
],
grid: {
top: 0,
left: 0,
bottom: 0,
right: 0,
},
});
写回答
3回答
-
慕哥9542403
2022-04-06
series: [{ type: 'bar', data: [200], barWidth: '10px', itemStyle: { color: '#45c946' } }, { type: 'bar', data: [250], barWidth: '10px', barGap: '-100%', z: "-1", itemStyle: { color: '#eee' } }]122022-05-29 -
真的太虚了
2022-05-15
第二个bar的data设置为50
00 -
SunShineQQ
2022-03-29
设置一个stack是不行的,添加一个
barGap
00
相似问题