|
|
@@ -3,6 +3,8 @@ package com.lc.ibps.components.verification.model2;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.lc.ibps.components.verification.regression.PolynomialRegression;
|
|
|
+import com.lc.ibps.components.verification.report.ChartDTO;
|
|
|
+import com.lc.ibps.components.verification.report.EchartsFreemarkerUtils;
|
|
|
import com.lc.ibps.components.verification.report.ReportDataDTO;
|
|
|
import com.lc.ibps.components.verification.report.TableDTO;
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
@@ -159,6 +161,42 @@ public class LinearRangeEP6A extends PVModel {
|
|
|
return reports;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, ChartDTO> buildChartDTO() {
|
|
|
+ Map<String,ChartDTO> charts = new HashMap<>();
|
|
|
+ charts.put("图1: 线性实验",buildChart1DTO());
|
|
|
+ charts.put("图2: 线性评价差值点图",buildChart2DTO());
|
|
|
+ return charts;
|
|
|
+ }
|
|
|
+
|
|
|
+ private ChartDTO buildChart2DTO() {
|
|
|
+ ChartDTO chartDTO = new ChartDTO();
|
|
|
+ double[][] data = new double[targetValues.length][2];
|
|
|
+ for (int i = 0; i < data.length; i++) {
|
|
|
+ data[i] = new double[]{i+1,diffs[1][i]};
|
|
|
+ }
|
|
|
+ chartDTO.setData(data);
|
|
|
+ final HashMap<String, Object> config = new HashMap<>();
|
|
|
+ config.put("yAxisUp",0.1);
|
|
|
+ config.put("yAxisLow",-0.1);
|
|
|
+
|
|
|
+ chartDTO.setOption(EchartsFreemarkerUtils.generate("/scatter/linesForRange.ftl",config));
|
|
|
+ return chartDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ private ChartDTO buildChart1DTO() {
|
|
|
+ ChartDTO chartDTO = new ChartDTO();
|
|
|
+ double[][] data = new double[targetValues.length][2];
|
|
|
+ for (int i = 0; i < data.length; i++) {
|
|
|
+ data[i] = new double[]{targetValues[i],means[i]};
|
|
|
+ }
|
|
|
+ chartDTO.setData(data);
|
|
|
+
|
|
|
+
|
|
|
+ chartDTO.setOption(EchartsFreemarkerUtils.generate("/scatter/polynomialRegression.ftl",new HashMap<>()));
|
|
|
+ return chartDTO;
|
|
|
+ }
|
|
|
+
|
|
|
private TableDTO buildTable1DTO(){
|
|
|
|
|
|
TableDTO table = new TableDTO();
|
|
|
@@ -239,6 +277,7 @@ public class LinearRangeEP6A extends PVModel {
|
|
|
LinearRangeEP6A ep6 = new LinearRangeEP6A(data, new double[]{0,24.09},1,3);
|
|
|
TableDTO tableDTO = ep6.buildDataTableDTO();
|
|
|
Map<String, TableDTO> stringTableDTOMap = ep6.buildReportTableDTO();
|
|
|
+ final Map<String, ChartDTO> stringChartDTOMap = ep6.buildChartDTO();
|
|
|
ReportDataDTO report = new ReportDataDTO();
|
|
|
|
|
|
|