Browse Source

[性能验证][task-1390] 各个指标中数据公式的计算和结论推导,线性范围

liyuan 2 năm trước cách đây
mục cha
commit
ea968d249f

+ 5 - 0
ibps-provider-root/modules/provider-business/pom.xml

@@ -62,6 +62,11 @@
 			<artifactId>pdfbox</artifactId>
 			<version>2.0.24</version>
 		</dependency>
+		<dependency>
+			<groupId>org.apache.poi</groupId>
+			<artifactId>ooxml-schemas</artifactId>
+			<version>1.4</version>
+		</dependency>
 
 		<!-- 北京CA电子签章jar包   -->
 		<dependency>

+ 10 - 4
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/excel/CreateExcelScatterChart.java

@@ -8,6 +8,8 @@ import org.apache.poi.ss.usermodel.charts.*;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.usermodel.XSSFChart;
 import org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterSer;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTTrendline;
+import org.openxmlformats.schemas.drawingml.x2006.main.STSchemeColorVal;
 
 public class CreateExcelScatterChart {
     public static void create(Sheet sheet) {
@@ -40,9 +42,13 @@ public class CreateExcelScatterChart {
             scatterChartSeries[i].addNewSpPr().addNewLn().addNewNoFill();
             scatterChartSeries[i].addNewSmooth().setVal(true);
         }
-//        ((XSSFChart) chart).getCTChart().getPlotArea().getScatterChartArray(0).getSerArray(0)
-//                .addNewTrendline()
-//                .addNewTrendlineType()
-//                .setVal(org.openxmlformats.schemas.drawingml.x2006.chart.STTrendlineType.LINEAR);
+        final CTTrendline trendline = ((XSSFChart) chart).getCTChart().getPlotArea().getScatterChartArray(0).getSerArray(0)
+                .addNewTrendline();
+        trendline.addNewDispRSqr().setVal(true);
+        trendline.addNewIntercept().setVal(0.1767);
+        trendline.addNewDispEq().setVal(true);
+        trendline.addNewSpPr().addNewLn().addNewSolidFill().addNewSchemeClr().setVal(STSchemeColorVal.Enum.forInt(5));
+        trendline.addNewTrendlineType()
+                .setVal(org.openxmlformats.schemas.drawingml.x2006.chart.STTrendlineType.LINEAR);
     }
 }