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

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

js 复制代码
itemStyle: { //柱子颜色
	normal: {
		color: '#4e73de',
		borderColor: "#fff",// 用border做
		borderWidth: 10,
	}
},

具体:

js 复制代码
    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: { //y轴刻度线
    			show: false
    		},
    		splitLine: { //网格
    			show: false,

    		}
    	},
    	yAxis: {
    		type: 'value',
    		axisLabel: { //坐标轴字体颜色
    			textStyle: {
    				color: '#9eaaba'
    			}
    		},
    		axisLine: {
    			show: false,
    		},
    		axisTick: { //y轴刻度线
    			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]
    	}]
    };
相关推荐
Mintopia3 分钟前
🎨 AiGC × Web Markdown:把 AI 的碎碎念渲染成人类能看懂的彩虹
前端·javascript·aigc
Mintopia6 分钟前
🚀 Next 数据库集成:建模篇
前端·javascript·next.js
Dignity_呱8 分钟前
一文彻底了解浏览器垃圾回收机制
前端·javascript·面试
柏成8 分钟前
写给前端仔仔的docker实战
前端·docker·面试
鹏多多15 分钟前
vue计算属性computed的详解
前端·javascript·vue.js
JarvanMo16 分钟前
Flutter 应用安全清单
前端
浩男孩19 分钟前
🍀实际开发中没想到 computed 在表单中还能这么使用🚀🚀
前端·vue.js
月下点灯22 分钟前
uniapp仿抖音评论区popup对话框实现(多端兼容)
前端·javascript·vue.js
江城开朗的豌豆32 分钟前
React的渲染时机:聊透虚拟DOM的更新机制
前端·javascript·react.js
anyup38 分钟前
🔥🔥 uView Pro:Vue3+TS重构的uni-app开源组件库,文档免费无广告!
前端·vue.js·uni-app