Commit d7cb02da1d0b45df7a600259697a2f7893763de5
1 parent
17b0b4ce
fix: DEFECT-696 data board component page data charts data keep out
Showing
1 changed file
with
15 additions
and
9 deletions
... | ... | @@ -104,9 +104,9 @@ export const instrumentComponent1 = (params?: Partial<ComponentInfo>): EChartsOp |
104 | 104 | detail: { |
105 | 105 | valueAnimation: true, |
106 | 106 | width: '60%', |
107 | - lineHeight: 30, | |
107 | + lineHeight: 10, | |
108 | 108 | borderRadius: 8, |
109 | - offsetCenter: [0, '-15%'], | |
109 | + offsetCenter: [0, '30%'], | |
110 | 110 | fontSize: 14, |
111 | 111 | fontWeight: 'bolder', |
112 | 112 | formatter: `{value} ${unit ?? ''}`, |
... | ... | @@ -220,6 +220,7 @@ export const instrumentComponent2 = (params?: Partial<ComponentInfo>): EChartsOp |
220 | 220 | valueAnimation: true, |
221 | 221 | formatter: `{value} ${unit ?? ''}`, |
222 | 222 | color: params?.fontColor || 'inherit', |
223 | + offsetCenter: [0, '70%'], | |
223 | 224 | fontSize: 14, |
224 | 225 | }, |
225 | 226 | data: [ |
... | ... | @@ -254,7 +255,8 @@ export const update_instrument_1_font = (radio: number) => { |
254 | 255 | }; |
255 | 256 | |
256 | 257 | export const update_instrument_2_font = (radio: number) => { |
257 | - const axisLabelFontSize = fontSize({ radio, basic: 10, max: 18 }); | |
258 | + const axisLabelFontSize = fontSize({ radio, basic: 10, max: 16 }); | |
259 | + const detailFontSize = fontSize({ radio, basic: 12 }); | |
258 | 260 | return { |
259 | 261 | series: [ |
260 | 262 | { |
... | ... | @@ -262,31 +264,35 @@ export const update_instrument_2_font = (radio: number) => { |
262 | 264 | fontSize: axisLabelFontSize, |
263 | 265 | }, |
264 | 266 | detail: { |
265 | - fontSize: axisLabelFontSize, | |
267 | + fontSize: detailFontSize, | |
266 | 268 | }, |
267 | 269 | }, |
268 | 270 | ], |
269 | 271 | } as EChartsOption; |
270 | 272 | }; |
271 | 273 | |
272 | -export const update_instrument_1_value = (value) => { | |
274 | +const handleValue = (value: any) => { | |
275 | + return Number(value).toFixed(2); | |
276 | +}; | |
277 | + | |
278 | +export const update_instrument_1_value = (value: number) => { | |
273 | 279 | return { |
274 | 280 | series: [ |
275 | 281 | { |
276 | - data: [{ value }], | |
282 | + data: [{ value: handleValue(value) }], | |
277 | 283 | }, |
278 | 284 | { |
279 | - data: [{ value }], | |
285 | + data: [{ value: handleValue(value) }], | |
280 | 286 | }, |
281 | 287 | ], |
282 | 288 | } as EChartsOption; |
283 | 289 | }; |
284 | 290 | |
285 | -export const update_instrument_2_value = (value) => { | |
291 | +export const update_instrument_2_value = (value: number) => { | |
286 | 292 | return { |
287 | 293 | series: [ |
288 | 294 | { |
289 | - data: [{ value }], | |
295 | + data: [{ value: handleValue(value) }], | |
290 | 296 | }, |
291 | 297 | ], |
292 | 298 | } as EChartsOption; | ... | ... |