echarts中的stack参数

在echarts中series里有个参数stack:
用于数据堆叠同个类目轴上,系列配置相同的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]
				},

			]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值