【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]
    	}]
    };
相关推荐
ZC跨境爬虫15 小时前
3D 地球卫星轨道可视化平台开发 Day6(SEC数据接口扩展实现)
前端·microsoft·3d·html·json·交互
qq_120840937115 小时前
Three.js 工程向:EffectComposer 后处理链路与色彩管理
开发语言·前端·javascript
|晴 天|15 小时前
评论系统与情感分析
前端·ai·typescript
沉默中爆发的IT男15 小时前
BGP基础配置实验总结
linux·服务器·前端
朝阳3915 小时前
前端学习方法(含前端成神之路)
前端·学习方法
张元清16 小时前
head.tsx 就是一个 React 组件:用 loader 数据动态生成 SEO meta
前端·javascript·面试
Hello--_--World16 小时前
ES16:Set 集合方法增强、Promise.try、迭代器助手、JSON 模块导入 相关知识
开发语言·javascript·json
lemon_yyds16 小时前
Element UI 实践踩坑- date-picker 组件 定制化type="daterange"
前端·css
Alice-YUE16 小时前
ai对话平台中的functioncalling+mcp
前端·笔记·学习·语言模型
MXN_小南学前端16 小时前
Vue 视频上传实战:视频预览、MediaRecorder 压缩与自定义上传
前端·vue.js