|
@@ -18,48 +18,55 @@ export const getMaxY = function (param) {
|
|
|
const max3 = Math.max(...param[2]);
|
|
|
maxval=Math.max(max1,max2,max3)
|
|
|
}
|
|
|
- const digitCount = maxval.toFixed(0).length;
|
|
|
- console.log(digitCount,'digitCount')
|
|
|
- let yMax = 0;
|
|
|
- if (digitCount < 2) {
|
|
|
- if (yMax < 0.5) {
|
|
|
- yMax = 1;
|
|
|
- } else if (yMax < 0.9) {
|
|
|
- yMax = 1.5;
|
|
|
- } else if (yMax < 5) {
|
|
|
- yMax = 10;
|
|
|
- } else {
|
|
|
- yMax = 15;
|
|
|
- }
|
|
|
- } else if (digitCount < 3) {
|
|
|
- const n = Number((Number(yMax.toFixed(0)) / 10).toFixed(0));
|
|
|
- if (yMax < n * 10 + 5) {
|
|
|
- yMax = (n + 1) * 10;
|
|
|
- } else {
|
|
|
- yMax = (n + 2) * 10;
|
|
|
- }
|
|
|
- } else if (digitCount < 4) {
|
|
|
- const n = Number((Number(yMax.toFixed(0)) / 100).toFixed(0));
|
|
|
- if (yMax < n * 100 + 50) {
|
|
|
- yMax = (n + 1) * 100;
|
|
|
- } else {
|
|
|
- yMax = (n + 2) * 100;
|
|
|
- }
|
|
|
- } else if (digitCount < 5) {
|
|
|
- const n = Number((Number(yMax.toFixed(0)) / 1000).toFixed(0));
|
|
|
- if (yMax < n * 1000 + 500) {
|
|
|
- yMax = (n + 1) * 1000;
|
|
|
- } else {
|
|
|
- yMax = (n + 1) * 1000 + 500;
|
|
|
- }
|
|
|
- } else if (digitCount < 6) {
|
|
|
- const n = Number((Number(yMax.toFixed(0)) / 10000).toFixed(0));
|
|
|
- if (yMax < n * 10000 + 5000) {
|
|
|
- yMax = (n + 1) * 10000;
|
|
|
- } else {
|
|
|
- yMax = (n + 1) * 10000 + 5000;
|
|
|
- }
|
|
|
- }
|
|
|
+ let yMax = (maxval * 1.6).toFixed(0);
|
|
|
+// const digitCount = yMax.toFixed(0).length;
|
|
|
+// console.log(digitCount,'digitCount')
|
|
|
+// let digFirst=yMax.toString().substring(0,1)
|
|
|
+// console.log(digFirst,'digFirst')
|
|
|
+
|
|
|
+
|
|
|
+ // const digitCount = maxval.toFixed(0).length;
|
|
|
+ // console.log(digitCount,'digitCount')
|
|
|
+ // let yMax = 0;
|
|
|
+ // if (digitCount < 2) {
|
|
|
+ // if (yMax < 0.5) {
|
|
|
+ // yMax = 1;
|
|
|
+ // } else if (yMax < 0.9) {
|
|
|
+ // yMax = 1.5;
|
|
|
+ // } else if (yMax < 5) {
|
|
|
+ // yMax = 10;
|
|
|
+ // } else {
|
|
|
+ // yMax = 15;
|
|
|
+ // }
|
|
|
+ // } else if (digitCount < 3) {
|
|
|
+ // const n = Number((Number(yMax.toFixed(0)) / 10).toFixed(0));
|
|
|
+ // if (yMax < n * 10 + 5) {
|
|
|
+ // yMax = (n + 1) * 10;
|
|
|
+ // } else {
|
|
|
+ // yMax = (n + 2) * 10;
|
|
|
+ // }
|
|
|
+ // } else if (digitCount < 4) {
|
|
|
+ // const n = Number((Number(yMax.toFixed(0)) / 100).toFixed(0));
|
|
|
+ // if (yMax < n * 100 + 50) {
|
|
|
+ // yMax = (n + 1) * 100;
|
|
|
+ // } else {
|
|
|
+ // yMax = (n + 2) * 100;
|
|
|
+ // }
|
|
|
+ // } else if (digitCount < 5) {
|
|
|
+ // const n = Number((Number(yMax.toFixed(0)) / 1000).toFixed(0));
|
|
|
+ // if (yMax < n * 1000 + 500) {
|
|
|
+ // yMax = (n + 1) * 1000;
|
|
|
+ // } else {
|
|
|
+ // yMax = (n + 1) * 1000 + 500;
|
|
|
+ // }
|
|
|
+ // } else if (digitCount < 6) {
|
|
|
+ // const n = Number((Number(yMax.toFixed(0)) / 10000).toFixed(0));
|
|
|
+ // if (yMax < n * 10000 + 5000) {
|
|
|
+ // yMax = (n + 1) * 10000;
|
|
|
+ // } else {
|
|
|
+ // yMax = (n + 1) * 10000 + 5000;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
return yMax
|
|
|
}
|
|
|
|
|
@@ -77,47 +84,48 @@ export const getMinY = function (param) {
|
|
|
const min3 = Math.min(...param[2]);
|
|
|
minval=Math.min(min1,min2,min3)
|
|
|
}
|
|
|
- const minDigitCount = minval.toFixed(0).length;
|
|
|
- let yMin = 0;
|
|
|
- if (minDigitCount < 2) {
|
|
|
- if (yMin> 0.5) {
|
|
|
- yMin = 0.5;
|
|
|
- } else if (yMin > 1.5) {
|
|
|
- yMin = 1.0;
|
|
|
- } else if (yMin > 10) {
|
|
|
- yMin = 5;
|
|
|
- } else {
|
|
|
- yMin = 15;
|
|
|
- }
|
|
|
- } else if (minDigitCount < 3) {
|
|
|
- const n = Number((Number(yMin.toFixed(0)) / 10).toFixed(0));
|
|
|
- if (n > 1) {
|
|
|
- yMin = (n - 1) * 10;
|
|
|
- } else {
|
|
|
- yMin = 10;
|
|
|
- }
|
|
|
- } else if (minDigitCount < 4) {
|
|
|
- const n = Number((Number(yMin.toFixed(0)) / 100).toFixed(0));
|
|
|
- if (n > 1) {
|
|
|
- yMin = (n - 1) * 100;
|
|
|
- } else {
|
|
|
- yMin = 100;
|
|
|
- }
|
|
|
- } else if (minDigitCount < 5) {
|
|
|
- const n = Number((Number(yMin.toFixed(0)) / 1000).toFixed(0));
|
|
|
- if (n > 1) {
|
|
|
- yMin = (n - 1) * 1000;
|
|
|
- } else {
|
|
|
- yMin = 1000;
|
|
|
- }
|
|
|
- } else if (minDigitCount < 6) {
|
|
|
- const n = Number((Number(yMin.toFixed(0)) / 10000).toFixed(0));
|
|
|
- if (n > 1) {
|
|
|
- yMin = (n - 1) * 10000;
|
|
|
- } else {
|
|
|
- yMin = 10000;
|
|
|
- }
|
|
|
- }
|
|
|
+ let yMin = (minval*0.7).toFixed(0);
|
|
|
+ // const minDigitCount = minval.toFixed(0).length;
|
|
|
+ // let yMin = 0;
|
|
|
+ // if (minDigitCount < 2) {
|
|
|
+ // if (yMin> 0.5) {
|
|
|
+ // yMin = 0.5;
|
|
|
+ // } else if (yMin > 1.5) {
|
|
|
+ // yMin = 1.0;
|
|
|
+ // } else if (yMin > 10) {
|
|
|
+ // yMin = 5;
|
|
|
+ // } else {
|
|
|
+ // yMin = 15;
|
|
|
+ // }
|
|
|
+ // } else if (minDigitCount < 3) {
|
|
|
+ // const n = Number((Number(yMin.toFixed(0)) / 10).toFixed(0));
|
|
|
+ // if (n > 1) {
|
|
|
+ // yMin = (n - 1) * 10;
|
|
|
+ // } else {
|
|
|
+ // yMin = 10;
|
|
|
+ // }
|
|
|
+ // } else if (minDigitCount < 4) {
|
|
|
+ // const n = Number((Number(yMin.toFixed(0)) / 100).toFixed(0));
|
|
|
+ // if (n > 1) {
|
|
|
+ // yMin = (n - 1) * 100;
|
|
|
+ // } else {
|
|
|
+ // yMin = 100;
|
|
|
+ // }
|
|
|
+ // } else if (minDigitCount < 5) {
|
|
|
+ // const n = Number((Number(yMin.toFixed(0)) / 1000).toFixed(0));
|
|
|
+ // if (n > 1) {
|
|
|
+ // yMin = (n - 1) * 1000;
|
|
|
+ // } else {
|
|
|
+ // yMin = 1000;
|
|
|
+ // }
|
|
|
+ // } else if (minDigitCount < 6) {
|
|
|
+ // const n = Number((Number(yMin.toFixed(0)) / 10000).toFixed(0));
|
|
|
+ // if (n > 1) {
|
|
|
+ // yMin = (n - 1) * 10000;
|
|
|
+ // } else {
|
|
|
+ // yMin = 10000;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
return yMin
|
|
|
}
|
|
|
|