Commit 5f0777fbba62cd676696e27314d0dac9c050e847

Authored by ww
1 parent de4055bb

fix: chart widget can not adaptive

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