|
1
|
+<template>
|
|
2
|
+ <div class="go-content-box">
|
|
3
|
+ <svg
|
|
4
|
+ xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+ xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
6
|
+ :width="w"
|
|
7
|
+ :height="h"
|
|
8
|
+ fill="none"
|
|
9
|
+ >
|
|
10
|
+ <defs>
|
|
11
|
+ <linearGradient id="subtitle_linear_0" x1="0%" y1="50%" x2="100%" y2="50%" gradientUnits="objectBoundingBox">
|
|
12
|
+ <stop offset="0" :stop-color="attribute.linearColors[0]" stop-opacity="1" />
|
|
13
|
+ <stop offset="0.498" :stop-color="attribute.linearColors[1]" stop-opacity="1" />
|
|
14
|
+ <stop offset="1" :stop-color="attribute.linearColors[2]" stop-opacity="1" />
|
|
15
|
+ </linearGradient>
|
|
16
|
+ <linearGradient id="subtitle_linear_1" x1="0%" y1="0%" x2="1%" y2="100%" gradientUnits="objectBoundingBox">
|
|
17
|
+ <stop offset="0" :stop-color="attribute.linearColors[3]" stop-opacity="0" />
|
|
18
|
+ <stop offset="0.5313" :stop-color="attribute.linearColors[4]" stop-opacity="1" />
|
|
19
|
+ <stop offset="0.9988" :stop-color="attribute.linearColors[5]" stop-opacity="0" />
|
|
20
|
+ </linearGradient>
|
|
21
|
+ <linearGradient id="subtitle_linear_2" x1="0%" y1="0%" x2="1%" y2="100%" gradientUnits="objectBoundingBox">
|
|
22
|
+ <stop offset="0" :stop-color="attribute.linearColors[6]" stop-opacity="0" />
|
|
23
|
+ <stop offset="0.5313" :stop-color="attribute.linearColors[7]" stop-opacity="1" />
|
|
24
|
+ <stop offset="0.9988" :stop-color="attribute.linearColors[8]" stop-opacity="0" />
|
|
25
|
+ </linearGradient>
|
|
26
|
+ <linearGradient id="subtitle_linear_3" x1="0%" y1="50%" x2="100%" y2="50%" gradientUnits="objectBoundingBox">
|
|
27
|
+ <stop offset="0" :stop-color="attribute.linearColors[9]" stop-opacity="1" />
|
|
28
|
+ <stop offset="1" :stop-color="attribute.linearColors[10]" stop-opacity="0" />
|
|
29
|
+ </linearGradient>
|
|
30
|
+ <linearGradient id="subtitle_linear_4" x1="100%" y1="50%" x2="0%" y2="50%" gradientUnits="objectBoundingBox">
|
|
31
|
+ <stop offset="0" :stop-color="attribute.linearColors[11]" stop-opacity="1" />
|
|
32
|
+ <stop offset="1" :stop-color="attribute.linearColors[12]" stop-opacity="0" />
|
|
33
|
+ </linearGradient>
|
|
34
|
+ </defs>
|
|
35
|
+ <g opacity="1" transform="translate(0 0) rotate(0 246 15)">
|
|
36
|
+ <path
|
|
37
|
+ id="矩形 23"
|
|
38
|
+ fill-rule="evenodd"
|
|
39
|
+ fill="url(#subtitle_linear_0)"
|
|
40
|
+ transform="translate(0 0) rotate(0 246 15)"
|
|
41
|
+ opacity="1"
|
|
42
|
+ :d="`M0,${h} L${w},${h} L${w},0 L0,0 L0,${h} Z`"
|
|
43
|
+ />
|
|
44
|
+ <g opacity="1" :transform="`translate(${w / 2 - 101 / 2 + 10} ${h / 2 - 10}) rotate(0 46 13)`">
|
|
45
|
+ <text>
|
|
46
|
+ <tspan
|
|
47
|
+ :x="attribute.fontPos.x"
|
|
48
|
+ :y="attribute.fontPos.y"
|
|
49
|
+ :font-size="attribute.fontSize"
|
|
50
|
+ line-height="0"
|
|
51
|
+ :fill="attribute.fontColor"
|
|
52
|
+ opacity="1"
|
|
53
|
+ font-family="YouSheBiaoTiHei"
|
|
54
|
+ letter-spacing="0"
|
|
55
|
+ >
|
|
56
|
+ {{ dataset }}
|
|
57
|
+ </tspan>
|
|
58
|
+ </text>
|
|
59
|
+ </g>
|
|
60
|
+ <path
|
|
61
|
+ id="矩形 25"
|
|
62
|
+ fill-rule="evenodd"
|
|
63
|
+ fill="url(#subtitle_linear_1)"
|
|
64
|
+ :transform="`translate(0 ${h / 2 - 13 / 2}) rotate(0 0.5 6.5)`"
|
|
65
|
+ opacity="1"
|
|
66
|
+ d="M0,13L1,13L1,0L0,0L0,13Z "
|
|
67
|
+ />
|
|
68
|
+ <path
|
|
69
|
+ id="矩形 25"
|
|
70
|
+ fill-rule="evenodd"
|
|
71
|
+ fill="url(#subtitle_linear_2)"
|
|
72
|
+ :transform="`translate(${w - 1} ${h / 2 - 13 / 2}) rotate(0 0.5 6.5)`"
|
|
73
|
+ opacity="1"
|
|
74
|
+ d="M0,13L1,13L1,0L0,0L0,13Z "
|
|
75
|
+ />
|
|
76
|
+ <g
|
|
77
|
+ opacity="1"
|
|
78
|
+ :transform="`translate(${w / 2 - 100.74343013959287 - 40} ${
|
|
79
|
+ h / 2 - 6.236860279185521
|
|
80
|
+ }) rotate(0 21.62828493020359 8.763139720814422)`"
|
|
81
|
+ >
|
|
82
|
+ <path
|
|
83
|
+ id="矩形 26"
|
|
84
|
+ fill-rule="evenodd"
|
|
85
|
+ fill="url(#subtitle_linear_3)"
|
|
86
|
+ transform="translate(14.256569860407183 8.274519052838347) rotate(0 14.5 0.5)"
|
|
87
|
+ opacity="1"
|
|
88
|
+ d="M0,1L29,1L29,0L0,0L0,1Z "
|
|
89
|
+ />
|
|
90
|
+ <path
|
|
91
|
+ id="多边形 1"
|
|
92
|
+ :style="{stroke: attribute.linearColors[13], strokeWidth: 1,strokeOpacity: 1}"
|
|
93
|
+ transform="translate(2.348076211353317 2.3480762113533187) rotate(30 6.415063509461105 6.4150635094611035)"
|
|
94
|
+ d="M6.42,0L0.86,3.21L0.86,9.62L6.42,12.83L11.97,9.62L11.97,3.21L6.42,0Z "
|
|
95
|
+ />
|
|
96
|
+ <path
|
|
97
|
+ id="圆形 8"
|
|
98
|
+ fill-rule="evenodd"
|
|
99
|
+ :style="{ fill: attribute.linearColors[14] }"
|
|
100
|
+ transform="translate(6.763139720814309 6.763139720814425) rotate(0 2 2)"
|
|
101
|
+ opacity="1"
|
|
102
|
+ d="M2,0C0.9,0 0,0.9 0,2C0,3.1 0.9,4 2,4C3.1,4 4,3.1 4,2C4,0.9 3.1,0 2,0Z "
|
|
103
|
+ />
|
|
104
|
+ </g>
|
|
105
|
+ <g
|
|
106
|
+ opacity="1"
|
|
107
|
+ :transform="`translate(${w / 2 + 90} ${
|
|
108
|
+ h / 2 - 6.240000000000009
|
|
109
|
+ }) rotate(0 21.62828493020359 8.763139720814422)`"
|
|
110
|
+ >
|
|
111
|
+ <path
|
|
112
|
+ id="矩形 26"
|
|
113
|
+ fill-rule="evenodd"
|
|
114
|
+ fill="url(#subtitle_linear_4)"
|
|
115
|
+ transform="translate(0 8.274519052838347) rotate(0 14.5 0.5)"
|
|
116
|
+ opacity="1"
|
|
117
|
+ d="M0,0L0,1L29,1L29,0L0,0Z "
|
|
118
|
+ />
|
|
119
|
+ <path
|
|
120
|
+ id="多边形 1"
|
|
121
|
+ :style="{stroke: attribute.linearColors[15], strokeWidth: 1, strokeOpacity: 1}"
|
|
122
|
+ transform="translate(28.07836663013154 2.3480762113533187) rotate(-30 6.415063509461105 6.4150635094611035)"
|
|
123
|
+ d="M0.86,9.62L6.42,12.83L11.97,9.62L11.97,3.21L6.42,0L0.86,3.21L0.86,9.62Z "
|
|
124
|
+ />
|
|
125
|
+ <path
|
|
126
|
+ id="圆形 8"
|
|
127
|
+ fill-rule="evenodd"
|
|
128
|
+ :style="{ fill: attribute.linearColors[16] }"
|
|
129
|
+ transform="translate(32.49343013959276 6.763139720814425) rotate(0 2 2)"
|
|
130
|
+ opacity="1"
|
|
131
|
+ d="M2,4C3.1,4 4,3.1 4,2C4,0.9 3.1,0 2,0C0.9,0 0,0.9 0,2C0,3.1 0.9,4 2,4Z "
|
|
132
|
+ />
|
|
133
|
+ </g>
|
|
134
|
+ </g>
|
|
135
|
+ </svg>
|
|
136
|
+ </div>
|
|
137
|
+</template>
|
|
138
|
+<script setup lang="ts">
|
|
139
|
+import { PropType, toRefs } from 'vue'
|
|
140
|
+import { CreateComponentType } from '@/packages/index.d'
|
|
141
|
+
|
|
142
|
+const props = defineProps({
|
|
143
|
+ chartConfig: {
|
|
144
|
+ type: Object as PropType<CreateComponentType>,
|
|
145
|
+ required: true
|
|
146
|
+ }
|
|
147
|
+})
|
|
148
|
+
|
|
149
|
+const { dataset, attribute } = toRefs(props.chartConfig.option)
|
|
150
|
+
|
|
151
|
+const { w, h } = toRefs(props.chartConfig.attr)
|
|
152
|
+</script>
|
|
153
|
+
|
|
154
|
+<style lang="scss" scoped>
|
|
155
|
+.go-content-box {
|
|
156
|
+ width: v-bind('w+"px"');
|
|
157
|
+ height: v-bind('h+"px"');
|
|
158
|
+ display: flex;
|
|
159
|
+ align-items: center;
|
|
160
|
+ justify-content: center;
|
|
161
|
+}
|
|
162
|
+</style> |
...
|
...
|
|