Blame view

src/components/VBerth.vue 1.87 KB
ea141a52   liuqimichale   泊位
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  <template>
      <div class="theme-wrap">
          <card-title> <span>泊位消息</span></card-title>
          <div class="theme-body">
              <account-num>
                  <span>总计</span>
              </account-num>
              <div class="income-echart" id="income-echart">
                  <bar-chart :chart-data="pieChartData"></bar-chart>
              </div>
          </div>
      </div>
  </template>
  
  <script>
  import CardTitle from './base/CardTitle'
  import AccountNum from './base/AccountNum'
  import barChart from './base/barChart'
  export default {
    name: 'VBerth',
    components: {
      CardTitle,
      AccountNum,
      barChart
    },
    data() {
      return {
        pieChartData: {
          yData: [1,1],
          legendData: ['空余','占有']
        },
      }
    },
    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);
  
      }
    }
  }
  </script>
  
  <style scoped lang="scss">
      .theme-wrap {
          height: 100%;
      }
      .theme-body {
          height: calc(100% - 30px);
          margin-left: 20px;
      }
      .income-echart{
          height: 70%;
      }
  
  </style>