From 4efefb9ada923a7a0480b49b292c498ff88ed15a Mon Sep 17 00:00:00 2001 From: wzp <2040239371@qq.com> Date: 星期三, 31 七月 2024 14:22:53 +0800 Subject: [PATCH] 优化图表里的标签显示,设置一定的偏移量,确保标签都在图表内 --- src/main/java/com/ots/project/tool/report/LAQ/chart/LAQAllChart.java | 79 +++++++++++++++++++++++++++++++++++++-- 1 files changed, 74 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..924d655 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,75 @@ perfomance = 0.0; } + + + + + //濡傛灉y杞村皬浜�1锛岃璁剧疆鎴�3锛屽線涓婄Щ鍔ㄤ竴涓� + if(perfomance<=1.2) + { + perfomance=perfomance+1.5; + } + //濡傛灉y杞村ぇ浜�97锛岃缃垚97锛屽線涓嬬Щ鍔ㄤ竴鐐癸紝濂界湅 + if(perfomance>=99) + { + perfomance=99.0; + } + + if(perfomance>33.0&&perfomance<34.0) + { + perfomance = perfomance+2.0; + } + + if(perfomance>66.0&&perfomance<67) + { + perfomance = perfomance+2.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(olas>66.0&olas<=67.0) + { + olas = olas -2.0; + } + } + + if(type==3) + { + //x杞磋寰�鍙宠竟绉诲姩 + if(olas>0.0 && olas<=3.0) + { + olas= olas + 1; + } + + if(olas>=32.0&olas<=33.0) + { + olas = olas -2.0; + } + } + List<SeriesData> seriesDatas = new ArrayList<>(); seriesDatas = Arrays.asList( new SeriesData("X 鍊�", Arrays.asList( @@ -382,7 +451,6 @@ new RowData("Y 鍊�", perfomance) )) ); - if(type==1) { @@ -410,6 +478,7 @@ dataIndex++; } } + } return seriesDataMap; @@ -457,7 +526,7 @@ { if(olas>67) { - seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")"); + seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")"); dataIndex++; } } @@ -466,7 +535,7 @@ { if(olas<=67 && olas>33) { - seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")"); + seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")"); dataIndex++; } } @@ -475,7 +544,7 @@ { if(olas<=33) { - seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"("+olasStr+"-"+perfomanceStr+")"); + seriesDataMapLables.put(dataIndex,laqTemplate.getName()+"\n("+olasStr+"-"+perfomanceStr+")"); dataIndex++; } -- Gitblit v1.9.1