echarts中的stack参数
在echarts中series里有个参数stack:用于数据堆叠,同个类目轴上,系列配置相同的stack,后一个系列的值会加在前一个系列之后,如图:series部分代码:series: [{type: 'bar',stack: 'Total1',itemStyle: {borderColor: 'transparent',color: 'transparent'},emphasis: {itemS
·
在echarts中series里有个参数stack:
用于数据堆叠,同个类目轴上,系列配置相同的stack,后一个系列的值会加在前一个系列之后,如图:
series部分代码:
series: [{
type: 'bar',
stack: 'Total1',
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
},
emphasis: {
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
}
},
data: [43, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
},
{
type: 'bar',
stack: 'Tota1',
label: {
show: true,
position: 'inside'
},
data: [580, 580, 100, 300, 500, 600, 200, 200, 300, 600, 600]
},
{
type: 'bar',
stack: 'Total2',
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
},
emphasis: {
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
}
},
data: [40, 20, 20, 20, 20, 20, 10, 10, 10, 10, 10]
},
{
type: 'bar',
stack: 'Total2',
label: {
show: true,
position: 'inside'
},
data: [480, 560, 100, 300, 500, 650, 200, 200, 300, 400, 400]
},
{
type: 'bar',
stack: 'Total3',
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
},
emphasis: {
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
}
},
data: [40, 20, 20, 50, 20, 20, 40, 10, 10, 10, 10]
},
{
type: 'bar',
stack: 'Total3',
label: {
show: true,
position: 'inside'
},
data: [480, 560, 300, 300, 500, 650, 400, 200, 300, 400, 400]
},
{
type: 'bar',
stack: 'Total4',
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
},
emphasis: {
itemStyle: {
borderColor: 'transparent',
color: 'transparent'
}
},
data: [20, 10, 10, 20, 40, 20, 30, 10, 10, 10, 10]
},
{
type: 'bar',
stack: 'Total4',
label: {
show: true,
position: 'inside'
},
data: [180, 660, 100, 200, 500, 550, 200, 200, 300, 400, 200]
},
]
更多推荐
已为社区贡献2条内容
所有评论(0)