Browse Source

程序恢复

chenw 6 years ago
parent
commit
d33e0c9263

+ 20 - 4
bi-server/src/main/java/com/usoftchina/bi/server/service/chart/ShowHistogramService.java

@@ -138,10 +138,26 @@ public class ShowHistogramService {
             }
 
             //无分组时Y值
-            if ("time".equals(xColumnType)){        //如果是时间类型
-                value = timeConverterUtil.getHistogramTimeValue(yColumn, xColumn, tableName, yAxisType, xAxisType, xAxisData, screenToColumnS);
-            }else {
-                value = showChartsMapper.getValues(yColumn, xColumn, tableName, yAxisType, screenToColumnS, screen, histogramConfigInfo.getMaxCount());
+            Iterator itX = xAxisData.iterator();
+            while (itX.hasNext()){
+                String xdata = (String)itX.next();
+                double valueOne = 0;
+                String valueOnes = null;
+                if ("time".equals(xColumnType)){
+                    valueOnes = timeConverterUtil.getTimeValueConverter(yColumn, xColumn, tableName, yAxisType, xAxisType, xdata, screenToColumnS);
+                }else {
+                    if (xdata == null || "".equals(xdata)){
+                        valueOnes = showChartsMapper.getValuesIsNull(yColumn, xColumn, tableName, yAxisType, screenToColumnS);
+                    }else {
+                        valueOnes = showChartsMapper.getXValue(yColumn, xColumn, tableName, yAxisType, xdata, screenToColumnS);
+                    }
+                }
+                if (valueOnes == null || "".equals(valueOnes)){
+                    valueOne = 0;
+                }else {
+                    valueOne = Double.parseDouble(valueOnes);
+                }
+                value.add(valueOne);
             }
 
             series.setName(xColumn);