diff --git a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java index c30679e0ee..c504a50644 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java +++ b/designer-chart/src/main/java/com/fr/design/chart/auto/AutoTypeCalculate.java @@ -102,22 +102,22 @@ public class AutoTypeCalculate { } private static boolean isNumberData(List values) { - for (String value : values) { - if (!isNumberData(value)) { - return false; + for (Pattern pattern : dataPatterns) { + if (isNumberData(values, pattern)) { + return true; } } - return true; + return false; } - private static boolean isNumberData(String value) { - for (Pattern pattern : dataPatterns) { + private static boolean isNumberData(List values, Pattern pattern) { + for (String value : values) { Matcher matcher = pattern.matcher(value); - if (matcher.matches()) { - return true; + if (!matcher.matches()) { + return false; } } - return false; + return true; } private static List calculateField(String tableName, List columns) {