lineOptions.js
1.46 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
function getLineOptions(obj) {
const { tooltipFormatter } = obj
var lineOptions = {
tooltip: {
trigger: 'axis',
borderWidth: 0,
backgroundColor: 'rgba(68,68,68,0.80)',
textStyle: {
color: '#FFFFFF',
fontSize: '8px'
},
formatter: tooltipFormatter || '',
confine: true
},
grid: {
left: '3%',
right: '4%',
top: '10%',
bottom: '10%',
containLabel: true
},
xAxis: {
type: 'category',
axisLabel: {
color: '#606266',
fontSize: '0.8em'
},
data: []
},
yAxis: {
type: 'value',
splitLine: {
lineStyle: {
color: 'rgba(96,98,102,0.2)'
}
},
splitNumber: 4
},
series: [
{
type: 'line',
symbol: 'circle',
itemStyle: {
color: '#F5AA01'
},
// 平滑曲线
smooth: true,
showSymbol: false,
// 折线背景色
areaStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(254, 84, 0, 0.3)'
},
{
offset: 1,
color: 'rgba(254, 84, 0, 0.01)'
}
]
}
},
data: []
}
]
}
return lineOptions
}
export default getLineOptions