config.ts
2.99 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { chartInitConfig } from '@/settings/designSetting'
import { CustomEchartsConfig } from './index'
import cloneDeep from 'lodash/cloneDeep'
export const option = {
//数据源设置 默认设置一个
dataset: `
{
backgroundColor: 'transparent',
tooltip: {
trigger: 'none'
},
xAxis: {
data: ["百分比"],
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false,
textStyle: {
color: '#e54035'
}
}
},
yAxis: {
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false
}
},
series: [{
name: '最上层立体圆',
type: 'pictorialBar',
symbolSize: [300, 45],
symbolOffset: [0, -20],
z: 12,
itemStyle: {
normal: {
color: '#363F5E'
}
},
data: [{
value: 100,
symbolPosition: 'end'
}]
}, {
name: '中间立体圆',
type: 'pictorialBar',
symbolSize: [300, 45],
symbolOffset: [0, -20],
z: 12,
itemStyle: {
normal: {
color: '#2B5B4D'
}
},
data: [{
value: 30,
symbolPosition: 'end'
}]
}, {
name: '最底部立体圆',
type: 'pictorialBar',
symbolSize: [300, 45],
symbolOffset: [0, 20],
z: 12,
itemStyle: {
normal: {
color: '#01CC04'
}
},
data: [101 - 40]
}, {
//底部立体柱
stack: '1',
type: 'bar',
itemStyle: {
normal: {
color: '#01CC04',
opacity: .7
}
},
label: {
show: true,
position: "top",
distance: 15,
color: "#FFFE00",
fontSize:50,
formatter:'{c}'+'%'
},
silent: true,
barWidth: 300,
barGap: '-100%', // Make series be overlap
data: [30]
}, {
//上部立体柱
stack: '1',
type: 'bar',
itemStyle: {
normal: {
color: '#36405E',
opacity: .7
}
},
silent: true,
barWidth: 300,
barGap: '-100%', // Make series be overlap
data: [100 - 30]
}]
}
`
}
export default class Config extends PublicConfigClass implements CreateComponentType {
public key = CustomEchartsConfig.key
public attr = { ...chartInitConfig, w: 1200, h: 800, zIndex: -1 }
public chartConfig = cloneDeep(CustomEchartsConfig)
public option = cloneDeep(option)
}