Blame view

src/components/VIncome.vue 1.87 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">
95fc0103   liuqimichale   收入信息
9
                  <bar-chart :chart-data="pieChartData"></bar-chart>
6ee688df   liuqimichale   收入信息
10
11
12
13
14
15
16
17
              </div>
          </div>
      </div>
  </template>
  
  <script>
  import CardTitle from './base/CardTitle'
  import AccountNum from './base/AccountNum'
95fc0103   liuqimichale   收入信息
18
  import barChart from './base/barChart'
6ee688df   liuqimichale   收入信息
19
20
21
22
  export default {
    name: 'VIncome',
    components: {
      CardTitle,
95fc0103   liuqimichale   收入信息
23
24
      AccountNum,
      barChart
6ee688df   liuqimichale   收入信息
25
26
27
    },
    data() {
      return {
95fc0103   liuqimichale   收入信息
28
29
30
31
        pieChartData: {
          yData: [1,1],
          legendData: ['空余','占有']
        },
6ee688df   liuqimichale   收入信息
32
      }
f197b24f   liuqimichale   引入echarts
33
34
    },
    mounted(){
95fc0103   liuqimichale   收入信息
35
      //this.drawBar();
f197b24f   liuqimichale   引入echarts
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
69
70
71
    },
    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);
95fc0103   liuqimichale   收入信息
72
  
f197b24f   liuqimichale   引入echarts
73
      }
6ee688df   liuqimichale   收入信息
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    }
  }
  </script>
  
  <style scoped lang="scss">
      .theme-wrap {
          height: 100%;
      }
      .theme-body {
          height: calc(100% - 30px);
          margin-left: 20px;
      }
      .income-echart{
          height: 70%;
6ee688df   liuqimichale   收入信息
88
89
90
      }
  
  </style>