// 车互换配件数量统计
var WHChartDom = document.getElementById('numberChart');
var WHChart = echarts.init(WHChartDom);
var WHOption;

let data = [220, 182, 191, 234, 290, 330, 310, 123, 442, 321, 90, 149];
WHOption = {
  grid: {
    top: '6%',
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ],
    axisLabel: {
      color: '#999',
      interval: 0,
    },
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    },
  },
  yAxis: {
    axisLine: {
      show: false
    },
    axisTick: {
      show: false
    },
    axisLabel: {
      color: '#999'
    },
    splitLine: {
        lineStyle: {
          color: '#ffffff20'
        }
    },
  },
  series: [
    {
      type: 'bar',
      showBackground: false,
      itemStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: '#83bff6' },
          { offset: 0.5, color: '#188df0' },
          { offset: 1, color: '#188df0' }
        ])
      },
      emphasis: {
        itemStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            { offset: 0, color: '#2378f7' },
            { offset: 0.7, color: '#2378f7' },
            { offset: 1, color: '#83bff6' }
          ])
        }
      },
      barMaxWidth: 24,
      data: data
    }
  ]
};

WHOption && WHChart.setOption(WHOption);

// 车互换配件状态统计
var JXJHChartDom = document.getElementById('statusChart');
var JXJHmyChart = echarts.init(JXJHChartDom);
var JXJHoption;

let JXJHdata = [220, 182, 191, 234, 290, 330, 310, 123, 442, 321, 90, 149];
JXJHoption = {
  title: {
    text: "车辆检修计划",
    textStyle: {
      fontSize: 14,
      color: '#fff'
    },
    left: 'center'
  },
  grid: {
    top: '12%',
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    data: ['013', '015', '016', '018', '022', '023', '027', '031', '035', '038', '042', '043', ],
    axisLabel: {
      color: '#999',
      interval: 0,
    },
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    },
  },
  yAxis: {
    axisLine: {
      show: false
    },
    axisTick: {
      show: false
    },
    axisLabel: {
      color: '#999'
    },
    splitLine: {
      lineStyle: {
        color: '#ffffff20'
      }
    },
  },
  series: [
    {
      name: '列检',
      type: 'bar',
      data: [
        2, 4, 7, 23, 25, 76, 135, 162, 32, 20, 6, 3
      ],
      markPoint: {
        data: [
          { type: 'max', name: 'Max' },
          { type: 'min', name: 'Min' }
        ]
      },
      markLine: {
        data: [{ type: 'average', name: 'Avg' }]
      }
    },
    {
      name: '日检',
      type: 'bar',
      data: [
        2, 5, 9, 26, 28, 70, 175, 182, 48, 18, 6, 2
      ],
      markPoint: {
        data: [
          { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
          { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
        ]
      },
      markLine: {
        data: [{ type: 'average', name: 'Avg' }]
      }
    },
    {
      name: '周检',
      type: 'bar',
      data: [
        2, 3, 5, 16, 18, 30, 55, 42, 48, 18, 6, 2
      ],
      markPoint: {
        data: [
          { name: 'Max', value: 182.2, xAxis: 7, yAxis: 183 },
          { name: 'Min', value: 2.3, xAxis: 11, yAxis: 3 }
        ]
      },
      markLine: {
        data: [{ type: 'average', name: 'Avg' }]
      }
    },
  ]
};

JXJHoption && JXJHmyChart.setOption(JXJHoption);

// 车互换配件数量统计
var WHChartDom1 = document.getElementById('taskChart');
var WHChart1 = echarts.init(WHChartDom1);
var WHOption1;

let data1 = [220, 182, 191, 234, 290, 330, 310, 123, 442, 321, 90, 149];
WHOption1 = {
  grid: {
    top: '6%',
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  xAxis: {
    data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月', ],
    axisLabel: {
      color: '#999',
      interval: 0,
    },
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    },
  },
  yAxis: {
    axisLine: {
      show: false
    },
    axisTick: {
      show: false
    },
    axisLabel: {
      color: '#999'
    },
    splitLine: {
        lineStyle: {
          color: '#ffffff20'
        }
    },
  },
  series: [
    {
      type: 'bar',
      showBackground: false,
      itemStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
          { offset: 0, color: '#83bff6' },
          { offset: 0.5, color: '#188df0' },
          { offset: 1, color: '#188df0' }
        ])
      },
      emphasis: {
        itemStyle: {
          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
            { offset: 0, color: '#2378f7' },
            { offset: 0.7, color: '#2378f7' },
            { offset: 1, color: '#83bff6' }
          ])
        }
      },
      barMaxWidth: 24,
      data: data1
    }
  ]
};

WHOption1 && WHChart1.setOption(WHOption1);