|
@@ -81,81 +81,81 @@ export default withLayout(() => {
|
81
|
81
|
}
|
82
|
82
|
}
|
83
|
83
|
|
84
|
|
- const createLineOptions = (source = []) => {
|
85
|
|
- const colorWithOpacity = op => `rgba(187,156,121, ${op})`
|
86
|
|
-
|
87
|
|
- const defaultOpt = {
|
88
|
|
- color: [colorWithOpacity(1)],
|
89
|
|
- xAxis: {
|
90
|
|
- type: 'category',
|
91
|
|
- boundaryGap: false,
|
92
|
|
- axisLabel: {
|
93
|
|
- textStyle: {
|
94
|
|
- color: '#666'
|
95
|
|
- }
|
96
|
|
- }
|
97
|
|
-
|
98
|
|
- },
|
99
|
|
- yAxis: {
|
100
|
|
- type: 'value',
|
101
|
|
- axisLabel: {
|
102
|
|
- textStyle: {
|
103
|
|
- color: '#666'
|
104
|
|
- }
|
105
|
|
- }
|
106
|
|
- },
|
107
|
|
- grid: {
|
108
|
|
- left: '10%',
|
109
|
|
- right: '8%',
|
110
|
|
- bottom: '12%',
|
111
|
|
- top: '15%',
|
112
|
|
- },
|
113
|
|
- series: [],
|
114
|
|
- }
|
115
|
|
- // 数据展示只展示 5 个
|
116
|
|
- const endValue = source.length - 1 > 0 ? source.length - 1 : 0
|
117
|
|
- const startValue = endValue - 5 > 0 ? endValue - 5 : 0
|
118
|
|
-
|
119
|
|
- return {
|
120
|
|
- ...defaultOpt,
|
121
|
|
- dataset: { source },
|
122
|
|
- dataZoom: [{
|
123
|
|
- type: 'inside',
|
124
|
|
- startValue, endValue,
|
125
|
|
- show: true,
|
126
|
|
- }],
|
127
|
|
- series: [{
|
128
|
|
- type: 'line',
|
129
|
|
- dimensions: ['name', 'value'],
|
130
|
|
- symbolSize: 6,
|
131
|
|
- smooth: true,
|
132
|
|
- label: {
|
133
|
|
- show: true,
|
134
|
|
- formatter: '{@value}人'
|
135
|
|
- },
|
136
|
|
- lineStyle: {
|
137
|
|
- shadowColor: colorWithOpacity(0.5),
|
138
|
|
- shadowBlur: 5,
|
139
|
|
- shadowOffsetY: 7
|
140
|
|
- },
|
141
|
|
- areaStyle: {
|
142
|
|
- color: {
|
143
|
|
- type: 'linear',
|
144
|
|
- x: 0,
|
145
|
|
- y: 0,
|
146
|
|
- x2: 0,
|
147
|
|
- y2: 1,
|
148
|
|
- colorStops: [{
|
149
|
|
- offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
|
150
|
|
- }, {
|
151
|
|
- offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
|
152
|
|
- }],
|
153
|
|
- global: false,
|
154
|
|
- }
|
155
|
|
- },
|
156
|
|
- }],
|
157
|
|
- }
|
158
|
|
- }
|
|
84
|
+ // const createLineOptions = (source = []) => {
|
|
85
|
+ // const colorWithOpacity = op => `rgba(187,156,121, ${op})`
|
|
86
|
+
|
|
87
|
+ // const defaultOpt = {
|
|
88
|
+ // color: [colorWithOpacity(1)],
|
|
89
|
+ // xAxis: {
|
|
90
|
+ // type: 'category',
|
|
91
|
+ // boundaryGap: false,
|
|
92
|
+ // axisLabel: {
|
|
93
|
+ // textStyle: {
|
|
94
|
+ // color: '#666'
|
|
95
|
+ // }
|
|
96
|
+ // }
|
|
97
|
+
|
|
98
|
+ // },
|
|
99
|
+ // yAxis: {
|
|
100
|
+ // type: 'value',
|
|
101
|
+ // axisLabel: {
|
|
102
|
+ // textStyle: {
|
|
103
|
+ // color: '#666'
|
|
104
|
+ // }
|
|
105
|
+ // }
|
|
106
|
+ // },
|
|
107
|
+ // grid: {
|
|
108
|
+ // left: '10%',
|
|
109
|
+ // right: '8%',
|
|
110
|
+ // bottom: '12%',
|
|
111
|
+ // top: '15%',
|
|
112
|
+ // },
|
|
113
|
+ // series: [],
|
|
114
|
+ // }
|
|
115
|
+ // // 数据展示只展示 5 个
|
|
116
|
+ // const endValue = source.length - 1 > 0 ? source.length - 1 : 0
|
|
117
|
+ // const startValue = endValue - 5 > 0 ? endValue - 5 : 0
|
|
118
|
+
|
|
119
|
+ // return {
|
|
120
|
+ // ...defaultOpt,
|
|
121
|
+ // dataset: { source },
|
|
122
|
+ // dataZoom: [{
|
|
123
|
+ // type: 'inside',
|
|
124
|
+ // startValue, endValue,
|
|
125
|
+ // show: true,
|
|
126
|
+ // }],
|
|
127
|
+ // series: [{
|
|
128
|
+ // type: 'line',
|
|
129
|
+ // dimensions: ['name', 'value'],
|
|
130
|
+ // symbolSize: 6,
|
|
131
|
+ // smooth: true,
|
|
132
|
+ // label: {
|
|
133
|
+ // show: true,
|
|
134
|
+ // formatter: '{@value}人'
|
|
135
|
+ // },
|
|
136
|
+ // lineStyle: {
|
|
137
|
+ // shadowColor: colorWithOpacity(0.5),
|
|
138
|
+ // shadowBlur: 5,
|
|
139
|
+ // shadowOffsetY: 7
|
|
140
|
+ // },
|
|
141
|
+ // areaStyle: {
|
|
142
|
+ // color: {
|
|
143
|
+ // type: 'linear',
|
|
144
|
+ // x: 0,
|
|
145
|
+ // y: 0,
|
|
146
|
+ // x2: 0,
|
|
147
|
+ // y2: 1,
|
|
148
|
+ // colorStops: [{
|
|
149
|
+ // offset: 0, color: colorWithOpacity(0.2) // 0% 处的颜色
|
|
150
|
+ // }, {
|
|
151
|
+ // offset: 1, color: colorWithOpacity(0) // 100% 处的颜色
|
|
152
|
+ // }],
|
|
153
|
+ // global: false,
|
|
154
|
+ // }
|
|
155
|
+ // },
|
|
156
|
+ // }],
|
|
157
|
+ // }
|
|
158
|
+ // }
|
159
|
159
|
|
160
|
160
|
return (
|
161
|
161
|
<view className='Page customerAnalyse flex-v'>
|