Commit 5f0777fbba62cd676696e27314d0dac9c050e847
1 parent
de4055bb
fix: chart widget can not adaptive
Showing
1 changed file
with
15 additions
and
18 deletions
| ... | ... | @@ -46,8 +46,8 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 46 | 46 | startAngle: 200, |
| 47 | 47 | endAngle: -20, |
| 48 | 48 | min: 0, |
| 49 | - max: 60, | |
| 50 | - splitNumber: 12, | |
| 49 | + max: 100, | |
| 50 | + splitNumber: 10, | |
| 51 | 51 | itemStyle: { |
| 52 | 52 | color: '#FFAB91', |
| 53 | 53 | }, |
| ... | ... | @@ -64,7 +64,7 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 64 | 64 | }, |
| 65 | 65 | }, |
| 66 | 66 | axisTick: { |
| 67 | - distance: -45, | |
| 67 | + distance: -35, | |
| 68 | 68 | splitNumber: 5, |
| 69 | 69 | lineStyle: { |
| 70 | 70 | width: 2, |
| ... | ... | @@ -72,7 +72,7 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 72 | 72 | }, |
| 73 | 73 | }, |
| 74 | 74 | splitLine: { |
| 75 | - distance: -52, | |
| 75 | + distance: -45, | |
| 76 | 76 | length: 14, |
| 77 | 77 | lineStyle: { |
| 78 | 78 | width: 3, |
| ... | ... | @@ -80,9 +80,9 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 80 | 80 | }, |
| 81 | 81 | }, |
| 82 | 82 | axisLabel: { |
| 83 | - distance: -20, | |
| 83 | + distance: -5, | |
| 84 | 84 | color: '#999', |
| 85 | - fontSize: 20, | |
| 85 | + // fontSize: 20, | |
| 86 | 86 | }, |
| 87 | 87 | anchor: { |
| 88 | 88 | show: false, |
| ... | ... | @@ -93,10 +93,10 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 93 | 93 | detail: { |
| 94 | 94 | valueAnimation: true, |
| 95 | 95 | width: '60%', |
| 96 | - lineHeight: 40, | |
| 96 | + lineHeight: 30, | |
| 97 | 97 | borderRadius: 8, |
| 98 | 98 | offsetCenter: [0, '-15%'], |
| 99 | - fontSize: 16, | |
| 99 | + // fontSize: 16, | |
| 100 | 100 | fontWeight: 'bolder', |
| 101 | 101 | formatter: `{value} ${unit}`, |
| 102 | 102 | color: 'auto', |
| ... | ... | @@ -113,7 +113,7 @@ export const instrumentComponent1 = (params?: { value: number; unit: string }): |
| 113 | 113 | startAngle: 200, |
| 114 | 114 | endAngle: -20, |
| 115 | 115 | min: 0, |
| 116 | - max: 60, | |
| 116 | + max: 100, | |
| 117 | 117 | itemStyle: { |
| 118 | 118 | color: '#FD7347', |
| 119 | 119 | }, |
| ... | ... | @@ -166,16 +166,12 @@ export const instrumentComponent2 = (params?: { |
| 166 | 166 | const secondGradient = secondRecord?.value ? secondRecord.value / max : 0.7; |
| 167 | 167 | // const thirdGradient = thirdRecord?.value ? thirdRecord.value / max : 1; |
| 168 | 168 | |
| 169 | - console.log(); | |
| 170 | 169 | return { |
| 171 | 170 | series: [ |
| 172 | 171 | { |
| 173 | 172 | type: 'gauge', |
| 174 | 173 | min: 0, |
| 175 | 174 | max, |
| 176 | - // startAngle: 225, | |
| 177 | - // endAngle: -70, | |
| 178 | - // splitNumber: 10, | |
| 179 | 175 | axisLine: { |
| 180 | 176 | lineStyle: { |
| 181 | 177 | width: 20, |
| ... | ... | @@ -201,7 +197,7 @@ export const instrumentComponent2 = (params?: { |
| 201 | 197 | }, |
| 202 | 198 | }, |
| 203 | 199 | splitLine: { |
| 204 | - distance: -30, | |
| 200 | + distance: -10, | |
| 205 | 201 | length: 30, |
| 206 | 202 | lineStyle: { |
| 207 | 203 | color: '#fff', |
| ... | ... | @@ -210,7 +206,7 @@ export const instrumentComponent2 = (params?: { |
| 210 | 206 | }, |
| 211 | 207 | axisLabel: { |
| 212 | 208 | color: 'auto', |
| 213 | - distance: 22, | |
| 209 | + distance: 5, | |
| 214 | 210 | fontSize: 6, |
| 215 | 211 | }, |
| 216 | 212 | detail: { |
| ... | ... | @@ -235,14 +231,15 @@ export const getGradient = (key: Gradient, record: GradientInfo[] = []) => { |
| 235 | 231 | }; |
| 236 | 232 | |
| 237 | 233 | export const update_instrument_1_font = (radio: number) => { |
| 234 | + const basicFontSize = fontSize({ radio, basic: 10, max: 20 }); | |
| 238 | 235 | return { |
| 239 | 236 | series: [ |
| 240 | 237 | { |
| 241 | 238 | axisLabel: { |
| 242 | - fontSize: fontSize({ radio, basic: 14 }), | |
| 239 | + fontSize: basicFontSize, | |
| 243 | 240 | }, |
| 244 | 241 | detail: { |
| 245 | - fontSize: fontSize({ radio, basic: 14 }), | |
| 242 | + fontSize: basicFontSize, | |
| 246 | 243 | }, |
| 247 | 244 | }, |
| 248 | 245 | ], |
| ... | ... | @@ -250,7 +247,7 @@ export const update_instrument_1_font = (radio: number) => { |
| 250 | 247 | }; |
| 251 | 248 | |
| 252 | 249 | export const update_instrument_2_font = (radio: number) => { |
| 253 | - const axisLabelFontSize = fontSize({ radio, basic: 10, max: 20 }); | |
| 250 | + const axisLabelFontSize = fontSize({ radio, basic: 10, max: 18 }); | |
| 254 | 251 | return { |
| 255 | 252 | series: [ |
| 256 | 253 | { | ... | ... |