var option ={
					tooltip: {},
					xAxis: {
						type:'value'
					},
					 grid: {
						left: "3%",
						right: "1%",
						bottom: "-1%",
						width: "300px",
						height: "300px",
						containLabel: true
					},
					yAxis: {
						type:'category',
						data:this.yardList.map(function(item){
							return item[1]
						})
					},
					series: [
						{
							// name: "购买总人数",
							type: "bar",
							barWidth: "15px",
							 barGap:"10%",   
							// barCategoryGap是不同类目间的距离
							barCategoryGap: "1%",
							data:this.yardList.map(function(item){
								return item[2]
							}),
							itemStyle: {
								color: "#9ACFBD"
							},
							// 实现数字展示在柱状图
							label: {
								show: true,
								position: 'inside',
								color:'black'
							},
						}
					]
				}
Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐