# 三.map3D
# 1.多个饼图
饼图背景
查看代码详情
<template>
<WebPie3d :config="getOptions" :data="data"></WebPie3d>
</template>
<script>
export default {
data() {
return {
data: [],
};
},
async created() {
let res = await this.$api.getPie(1);
if (res.data) {
this.data = res.data.map((item) => ({ ...item, value: item.descript }));
}
},
methods: {
getOptions(data) {
return {
backgroundColor: "#000",
globe: {
// baseTexture: ROOT_PATH + "/data-gl/asset/earth.jpg",
// heightTexture:
// ROOT_PATH + "/data-gl/asset/bathymetry_bw_composite_4k.jpg",
displacementScale: 0.1,
shading: "lambert",
// environment: ROOT_PATH + "/data-gl/asset/starfield.jpg",
light: {
ambient: {
intensity: 0.1,
},
main: {
intensity: 1.5,
},
},
layers: [
{
type: "blend",
blendTo: "emission",
// texture: ROOT_PATH + "/data-gl/asset/night.jpg",
},
{
type: "overlay",
// texture: ROOT_PATH + "/data-gl/asset/clouds.png",
shading: "lambert",
distance: 5,
},
],
},
series: [],
};
},
},
};
</script>
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
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