From 7df8a8bea313a270014a1de4ae0de4c69172c5bf Mon Sep 17 00:00:00 2001
From: wzp <2040239371@qq.com>
Date: 星期三, 31 七月 2024 11:15:43 +0800
Subject: [PATCH] 优化图表里的标签显示,设置一定的偏移量,确保标签都在图表内

---
 src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java b/src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java
index fea779f..4308b1c 100644
--- a/src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java
+++ b/src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java
@@ -176,7 +176,7 @@
                         for (CTScatterSer ser : scatterChart.getSerList()) {
                             //鏇存柊鏁g偣鍥剧紦瀛�
                             updateScatterChart(seriesDatas, ser.getXVal(), ser.getYVal());
-                            ser.getTx().getStrRef().getStrCache().getPtArray(0).setV(lables);
+                            ser.getTx().getStrRef().getStrCache().getPtArray(0).setV(lables);//璁剧疆鏍囩
                             ++i;
                         }
 
@@ -373,6 +373,54 @@
                 perfomance = 0.0;
             }
 
+
+
+
+
+            //濡傛灉y杞村皬浜�1锛岃璁剧疆鎴�3锛屽線涓婄Щ鍔ㄤ竴涓�
+            if(perfomance<=1.2)
+            {
+                perfomance=perfomance+1.2;
+            }
+            //濡傛灉y杞村ぇ浜�97锛岃缃垚97锛屽線涓嬬Щ鍔ㄤ竴鐐癸紝濂界湅
+            if(perfomance>=99)
+            {
+                perfomance=99.0;
+            }
+
+            if(type==1)
+            {
+                //x杞磋寰�鍙宠竟绉诲姩
+                if(olas>67.0&olas<=70.0)
+                {
+                    olas=olas+1.5;
+                }
+
+                if(olas>=99.0)
+                {
+                    olas = olas-2.0;
+                }
+            }
+
+            if(type==2)
+            {
+                //x杞磋寰�鍙宠竟绉诲姩
+                if(olas>=33.0&olas<=35.0)
+                {
+                    olas= olas+1;
+                }
+            }
+
+            if(type==3)
+            {
+                //x杞磋寰�鍙宠竟绉诲姩
+                if(olas>0.0 && olas<=3.0)
+                {
+                    olas= olas + 1;
+                }
+
+            }
+
             List<SeriesData> seriesDatas = new ArrayList<>();
             seriesDatas = Arrays.asList(
                     new SeriesData("X 鍊�", Arrays.asList(
@@ -382,7 +430,6 @@
                             new RowData("Y 鍊�", perfomance)
                     ))
             );
-
 
             if(type==1)
             {
@@ -410,6 +457,7 @@
                     dataIndex++;
                 }
             }
+
         }
 
         return  seriesDataMap;
@@ -457,7 +505,7 @@
             {
                 if(olas>67)
                 {
-                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")");
+                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")");
                     dataIndex++;
                 }
             }
@@ -466,7 +514,7 @@
             {
                 if(olas<=67 && olas>33)
                 {
-                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")");
+                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")");
                     dataIndex++;
                 }
             }
@@ -475,7 +523,7 @@
             {
                 if(olas<=33)
                 {
-                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")");
+                    seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")");
 
                     dataIndex++;
                 }

--
Gitblit v1.9.1