Blame view

src/components/VIncome.vue 1.69 KB
6ee688df   liuqimichale   收入信息
1
2
3
4
5
6
7
  <template>
      <div class="theme-wrap">
          <card-title> <span>收入消息</span></card-title>
          <div class="theme-body">
              <account-num>
                  <span>总计</span>
              </account-num>
f197b24f   liuqimichale   引入echarts
8
              <div class="income-echart" id="income-echart">
6ee688df   liuqimichale   收入信息
9
10
11
12
13
14
15
16
17
  
              </div>
          </div>
      </div>
  </template>
  
  <script>
  import CardTitle from './base/CardTitle'
  import AccountNum from './base/AccountNum'
f197b24f   liuqimichale   引入echarts
18
  import echarts from 'echarts'
6ee688df   liuqimichale   收入信息
19
20
21
22
23
24
25
26
27
28
  export default {
    name: 'VIncome',
    components: {
      CardTitle,
      AccountNum
    },
    data() {
      return {
  
      }
f197b24f   liuqimichale   引入echarts
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
    },
    mounted(){
      this.drawBar();
    },
    methods: {
      drawBar() {
        let myChart = echarts.init(document.getElementById('income-echart'));
        let option = {
          color: ['#f44'],
          tooltip : {
            trigger: 'axis',
            axisPointer : {
              type : 'shadow'
            }
          },
          xAxis : [
            {
              type : 'category',
              data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月',],
              axisTick: {
                alignWithLabel: true
              }
            }
          ],
          yAxis : [
            {
              type : 'value'
            }
          ],
          series : [
            {
              name:'每月花费',
              type:'bar',
              barWidth: '60%',
              data:[995,666,444,858,654,236,645,546,846,225,547,356]
            }
          ]
        };
        myChart.setOption(option);
      }
6ee688df   liuqimichale   收入信息
69
70
71
72
73
74
75
76
77
78
79
80
81
82
    }
  }
  </script>
  
  <style scoped lang="scss">
      .theme-wrap {
          height: 100%;
      }
      .theme-body {
          height: calc(100% - 30px);
          margin-left: 20px;
      }
      .income-echart{
          height: 70%;
6ee688df   liuqimichale   收入信息
83
84
85
      }
  
  </style>