- function char2() {
- var myChart = echarts.init($("#echart5")[0]);
- option = {
- //backgroundColor: '#00265f',
- tooltip : {
- trigger: 'axis',
- axisPointer : { // 坐标轴指示器,坐标轴触发有效
- type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {show:'true',borderWidth:'0'},
- legend: {
- data:['缺勤','在岗','上班未上岗'],
- textStyle : {
- fontSize: 12,
- color : '#ffffff'
- },
- icon:"rect",
- itemWidth:10,
- itemHeight:10,
- bottom:"0%"
- },
- calculable :false,
- xAxis : [
- {
- type : 'value',
- show:false,
- axisLabel: {
- show: true,
- textStyle: {
- color: '#fff'
- }
- },
- splitLine:{
- "show": false,
- lineStyle:{
- color:['#f2f2f2'],
- width:0,
- type:'solid'
- }
- }
- }
- ],
- yAxis : [
- {
- type : 'category',
- data : ['组装一课','组装二课','组装三课','组装四课','组装五课'],
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.5)',
- fontSize:'12',
- }
- },
- splitLine:{
- lineStyle:{
- width:0,
- type:'solid'
- }
- }
- }
- ],
- series : [
- {
- name:'缺勤',
- type:'bar',
- stack: '总量',
- itemStyle : {
- normal: {
- label : {show: true, position: 'insideRight'},
- color:'#623AD1',
- opacity: 1,
- barBorderRadius: 6,
- }},
- data:[21, 17, 13,8,13]
- },
- {
- name:'在岗',
- type:'bar',
- stack: '总量',
- itemStyle : {
- normal: {
- label : {show: true, position: 'insideRight'},
- color:'#2f89cf',
- opacity: 1,
- barBorderRadius: 6,
- }},
- data:[122, 93, 117,100,98]
- },
- {
- name:'上班未上岗',
- type:'bar',
- stack: '总量',
- itemStyle : {
- normal: {
- label : {show: true, position: 'insideRight'},
- color:'#c23531',
- opacity: 1,
- barBorderRadius: 6,
- }},
- data:[21,8,13,25,17]
- },
- ]
- };
- myChart.setOption(option);
- window.addEventListener('resize', function () {myChart.resize();})
- }
复制代码 |