
<template>
  <div style="height: 360px" id="dtdcChart"/>
</template>

<style scoped lang="scss"></style>
<script>
import * as echarts from 'echarts'
import resize from '@/mixins/ems/resize'

export default {
  mixins: [resize],
  data() {
    return {
      chart: null
    }
  },
  beforeDestroy() {
    if (!this.chart) {
      return
    }
    this.chart.dispose()
    this.chart = null
  },
  methods: {
    initChart() {
      this.chart = echarts.init(document.querySelector('#dtdcChart'))
    },
    setOption() {
      this.chart.setOption({
        color:['#FFBD00','#3C81FF'],
        legend: {
          left: 'center',
          bottom: '10',
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: { // 坐标轴指示器，坐标轴触发有效
            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
          }
        },
        textStyle:{
          color:"#333333",
        },
        xAxis: {
          data: ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'],
        },
        yAxis: {
          type: 'value',
        },
        series: [
          {
            name:'昨天',
            data: [80,92,1,34,90,130,320,80,9,91,34,90],
            type: 'bar',

          },{
            name:'今天',
            data: [820,932,901,934,1290,1330,1320,820,932,901,934,1290],
            type: 'bar',
          }]
      })
      this.chart.hideLoading()

    }
  }
}

</script>
