|
|
@@ -12,6 +12,7 @@ import com.usoftchina.bi.core.jdbc.DynamicDataSourceContextHolder;
|
|
|
import com.usoftchina.bi.server.utils.ScreenUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Iterator;
|
|
|
@@ -132,29 +133,36 @@ public class ShowScatterService {
|
|
|
}
|
|
|
|
|
|
//无分组时Y值
|
|
|
- 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 (!"time".equals(xColumnType)) {
|
|
|
+ if (StringUtils.isEmpty(screenToColumnS)) {
|
|
|
+ screenToColumnS = " 1 = 1 ";
|
|
|
}
|
|
|
- if (valueOnes == null || "".equals(valueOnes)){
|
|
|
- valueOne = 0;
|
|
|
- }else {
|
|
|
- valueOne = Double.parseDouble(valueOnes);
|
|
|
+ value = showChartsMapper.getXAndYValues(yColumn, xColumn, tableName, yAxisType, screenToColumnS);
|
|
|
+ }else {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ LineSeriesMap lineSeriesMap = new LineSeriesMap();
|
|
|
+ lineSeriesMap.setValue(valueOne);
|
|
|
+ lineSeriesMap.setDate(xdata);
|
|
|
+ value.add(lineSeriesMap);
|
|
|
}
|
|
|
- LineSeriesMap lineSeriesMap = new LineSeriesMap();
|
|
|
- lineSeriesMap.setValue(valueOne);
|
|
|
- lineSeriesMap.setDate(xdata);
|
|
|
- value.add(lineSeriesMap);
|
|
|
}
|
|
|
LineSeries series = new LineSeries();
|
|
|
// series.setName(yColumn);
|