yujing.js 1.5 KB
var chartDom = document.getElementById('main');
		var myChart = echarts.init(chartDom);
		var option;
		
		option = {
			// width:'90%',
			// heigt:'90%',
			grid:{
				// left:'10%',
			},
		  xAxis: [{
			axisTick: {
			show: false
			},
			axisLabel:{
				textStyle:{
					color:'#fff',
					// fontSize:14,
				}
			},
			axisLine:{
				lineStyle:{
					color:'#5456CB',
				}
			},
			type: 'category',
			data: ['紧急', '主要', '次要', '已处理', '提示', '其它', '其它']
		  }],
		  yAxis:{
			  name:'单位/条',
			  nameTextStyle:{
				  color:'#fff',
			  },
			  nameLocation:'end',
			  color:['#fff'],
			  splitLine:{
				  show:true,
				  lineStyle:{
					  color:['#5456CB'],
					  width:1,
					  type:'solid',
				  },
			  },
			  axisLine:{
				  lineStyle:{
					  color:'#5456CB',
				  }
			  },
			  axisLabel:{
				textStyle:{
					color:'#fff',
					fontSize:12,
				}
			  },
			  axisTick: {
			  show: false
			  },
		  },
		  series: [
			{
				data: [2000, 4000, 8000, 10000, 8000, 4000, 2000],
				type: 'bar',
				barWidth: '50%',
				itemStyle:{
				  normal:{
					  label:{
						  show:true,
						  position:'top',
						  textStyle:{
							  color:'#fff',
							  fontSize:12,
						  }
					  },
					  color:function(params){
						  var colorList = [
							  '#FF0000','#DD4103','#CBDD03','#006699','#00FDFD','#008CCC','#999933',
						  ];
						  return colorList[params.dataIndex]
					  },
				  }
			  }
			}
		  ]
		};
		
		option && myChart.setOption(option);