【echarts】 堆叠柱状图,柱子之间间隔开

9,044次阅读
没有评论

共计 1349 个字符,预计需要花费 4 分钟才能阅读完成。

【echarts】堆叠柱状图,柱子之间间隔开

https://echarts.zhangmuchen.top/#/detail?cid=85095-9454-8a93-b33d7-999a76a3

itemStyle: { 
	normal: {
		color: '#4e73de',
		borderColor: "#fff",
		borderWidth: 10,
	}
},

具体:

    option = {
    	backgroundColor: '#fff',
    	title: {
    		text: "策略变更",
    		top: 10,
    		left: 15,
    		textStyle: {
    			color: "#35598d",
    			fontSize: 16,
    			fontWeight: 'normal'
    		}
    	},
    	tooltip: {
    		trigger: 'axis',
    	},
    	grid: {
    		left: '5%',
    		right: '6%',
    		bottom: '3%',
    		top: '20%',
    		containLabel: true
    	},
    	legend: {
    		icon: 'rect',
    		right: "3%",
    		top: 13,
    		itemWidth: 20,
    		itemHeight: 10,
    		textStyle: {
    			color: '#555'
    		},
    		data: ['新增', '修改', '删除']
    	},
    	xAxis: {
    		type: 'category',
    		data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
    		axisLabel: { 
    			textStyle: {
    				color: '#9eaaba'
    			}
    		},
    		axisLine: {
    			lineStyle: {
    				color: "#e5e5e5"
    			}
    		},
    		axisTick: { 
    			show: false
    		},
    		splitLine: { 
    			show: false,

    		}
    	},
    	yAxis: {
    		type: 'value',
    		axisLabel: { 
    			textStyle: {
    				color: '#9eaaba'
    			}
    		},
    		axisLine: {
    			show: false,
    		},
    		axisTick: { 
    			show: false
    		},
    		splitLine: { 
    			show: true,
    			lineStyle: {
    				color: '#dadde4',
    				type: "dashed"
    			}
    		}
    	},
    	series: [{
    		name: '新增',
    		type: 'bar',
    		stack: '策略变更',
    		barWidth: '40%', 
    		itemStyle: { 
    			normal: {
    				color: '#4e73de',
    				borderColor: "#fff",
    				borderWidth: 10,
    			}
    		},
    		data: [232, 193, 240, 214, 239, 223, 202]
    	}, {
    		name: '修改',
    		type: 'bar',
    		stack: '策略变更',
    		barWidth: '40%', 
    		itemStyle: { 
    			normal: {
    				color: '#2dafeb',
    				borderColor: "#fff",
    				borderWidth: 10,
    			}
    		},
    		data: [320, 332, 301, 334, 390, 330, 320]
    	}, {
    		name: '删除',
    		type: 'bar',
    		stack: '策略变更',
    		barWidth: '40%', 
    		itemStyle: { 
    			normal: {
    				color: '#35c68d',
    				borderColor: "#fff",
    				borderWidth: 10,
    			}
    		},
    		data: [60, 82, 51, 94, 100, 68, 74]
    	}]
    };

原文地址: 【echarts】堆叠柱状图,柱子之间间隔开

    正文完
     0
    Yojack
    版权声明:本篇文章由 Yojack 于2024-11-03发表,共计1349字。
    转载说明:
    1 本网站名称:优杰开发笔记
    2 本站永久网址:https://yojack.cn
    3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行删除处理。
    4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
    5 本站所有内容均可转载及分享, 但请注明出处
    6 我们始终尊重原创作者的版权,所有文章在发布时,均尽可能注明出处与作者。
    7 站长邮箱:laylwenl@gmail.com
    评论(没有评论)