<template>
  <div id="card-1">
    <el-row>
      <el-col :span="24" class="main">
        <div id="card_one" style="width: 100%; height: 17vw"></div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import * as echarts from 'echarts';
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'index',
  props: {},
  components: {},
  data: function () {
    return {};
  },
  computed: {
    ...mapState(['user']),
  },
  mounted() {
    this.getEchartData();
  },
  created() {},
  methods: {
    getEchartData(data) {
      var chartDom = document.getElementById('card_one');
      var myChart = echarts.init(chartDom);
      var option;
      option = {
        title: {
          text: '本周下单数',
        },
        color: '#FFD700',
        tooltip: {
          trigger: 'axis',
        },
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        },
        yAxis: {
          type: 'value',
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'line',
          },
        ],
      };
      myChart.setOption(option);
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped></style>
