hejianhao
2025-04-16 dab2d210ca06c1faa514c6388fbd5de1ab355360
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
91
92
93
<template>
    <div>
        <div id="charts1" class="charts1"></div>
    </div>
</template>
<script>
    export default {
      props: {
        detail:{
          type:Object,
          default:_=>{return {} }
        }
      },
        components: {},
        data() {
            return {}
        },
        created() {
        },
        mounted() {
          this.chart()
        },
        methods: {
          chart(){
            var chartDom = document.getElementById('charts1');
            var myChart = echarts.init(chartDom);
            var option;
            option = {
              tooltip: {
                trigger: 'axis',
                axisPointer: {
                  type: 'cross',
                  label: {
                    backgroundColor: '#6a7985'
                  }
                }
              },
              grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
              },
              xAxis: [
                {
                  type: 'category',
                  boundaryGap: false,
                  data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
                }
              ],
              yAxis: [
                {
                  type: 'value'
                }
              ],
              series: [
                {
                  name: '完成微心愿',
                  type: 'line',
                  stack: 'Total',
                  areaStyle: {},
                  emphasis: {
                    focus: 'series'
                  },
                  data: this.detail.completeWishList||[0,0,0,0,0,0,0,0,0,0,0,0]
                },
                {
                  name: '累计完成',
                  type: 'line',
                  stack: 'Total',
                  areaStyle: {},
                  emphasis: {
                    focus: 'series'
                  },
                  data: this.detail.cumulativeWishList||[0,0,0,0,0,0,0,0,0,0,0,0]
                }
              ]
            };
 
            option && myChart.setOption(option);
          }
        },
        watch: {},
        computed: {}
    }
 
</script>
<style scoped>
  .charts1{
    width: 600px;
    height: 350px;
  }
</style>