<template>
  <div>
    <charts
      style="margin-top: -40px"
      id="bizchart2"
      height="250px"
      width="440px"
      :option="option"
    />
  </div>
</template>

<script lang="js">
import charts from '../../../components/echarts/index.vue'
import * as echarts from 'echarts'
export default {
  components: { charts },
  data() {
    return {
      option : {
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        legend: {},
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: {
          type: 'value',
          boundaryGap: [0, 0.01],
          axisLine: {
            lineStyle: {
              color: "#a4a2a2",
            }
          },
          axisLabel: {
            textStyle: {
              color: "#a4a2a2",
            },
          },
          splitLine: {
            show: true,
            lineStyle: {
              color:'rgba(128,126,126,0.25)'
            },
          },
        },
        yAxis: {
          type: 'category',
          data: ['5.', '4.', '3.', '2.', '1.'],
          axisLine: {
            lineStyle: {
              color: "#a4a2a2",
            }
          },
          axisLabel: {
            textStyle: {
              fontSize: "20",
              color: function(params,index) {
               if (index > 1){
                 return '#FFA100'
               }else {
                 return '#FFFFFF'
               }
              },
              fontWeight:'bold'
            },
          },
        },
        label: {
          show: true,
          position: 'right',
        },
        textStyle: {
          color:'rgba(245,126,31,0.74)'
        },
        series: [
          {
            type: 'bar',
            data: [ 23489, 29034, 104970, 131744, 630230],
            itemStyle: {
              normal: {
                barBorderRadius: 20,
                color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
                  offset: 1,
                  color: 'rgba(134,73,24,0.74)'
                }, {
                  offset: 0,
                  color: 'rgba(245,126,31,0.74)'
                }]),
              }
            }
          },
        ]
      }
    }
  },
  created() {
    this.timingAcquisition()
  },
  methods: {
    timingAcquisition() {
      setInterval(() => {

      }, 10000)
    },

  }
}
</script>
