admin
2024-09-26 dd4b7015b8466e454d6d8ec2352586f255f33412
提交 | 用户 | 时间
dd4b70 1 <template>
A 2   <div>
3     <Echart
4       :options="options"
5       id="centreLeft1Chart"
6       height="320px"
7       width="260px"
8     ></Echart>
9   </div>
10 </template>
11
12 <script>
13 import Echart from '@/common/echart'
14 export default {
15   data () {
16     return {
17       options: {},
18     };
19   },
20   components: {
21     Echart,
22   },
23   props: {
24     cdata: {
25       type: Object,
26       default: () => ({})
27     },
28   },
29   watch: {
30     cdata: {
31       handler (newData) {
32         this.options = {
33           color: [
34             "#37a2da",
35             "#32c5e9",
36             "#9fe6b8",
37             "#ffdb5c",
38             "#ff9f7f",
39             "#fb7293",
40             "#e7bcf3",
41             "#8378ea"
42           ],
43           tooltip: {
44             trigger: "item",
45             formatter: "{a} <br/>{b} : {c} ({d}%)"
46           },
47           toolbox: {
48             show: true
49           },
50           calculable: true,
51           legend: {
52             orient: "horizontal",
53             icon: "circle",
54             bottom: 0,
55             x: "center",
56             data: newData.xData,
57             textStyle: {
58               color: "#fff"
59             }
60           },
61           series: [
62             {
63               name: "通过率统计",
64               type: "pie",
65               radius: [10, 50],
66               roseType: "area",
67               center: ["50%", "40%"],
68               data: newData.seriesData
69             }
70           ]
71         }
72       },
73       immediate: true,
74       deep: true
75     }
76   }
77 };
78 </script>
79
80 <style lang="scss" scoped>
81 </style>