Commit 7ed722d3184a9ab46ccb4df99c7ed7bc5235223c

Authored by 胡翰林
1 parent da8096fc

统计报表需求修改

@@ -62,8 +62,8 @@ public class JFChartUtils { @@ -62,8 +62,8 @@ public class JFChartUtils {
62 NumberAxis numberaxis = (NumberAxis) plot.getRangeAxis(); 62 NumberAxis numberaxis = (NumberAxis) plot.getRangeAxis();
63 numberaxis.setUpperMargin(0.1); 63 numberaxis.setUpperMargin(0.1);
64 numberaxis.setLowerMargin(0.1); 64 numberaxis.setLowerMargin(0.1);
65 - numberaxis.setTickLabelFont(new Font("宋体", Font.BOLD, 16));  
66 - numberaxis.setLabelFont(new Font("宋体", Font.BOLD, 16)); 65 + numberaxis.setTickLabelFont(new Font("宋体", Font.BOLD, 20));
  66 + numberaxis.setLabelFont(new Font("宋体", Font.BOLD, 20));
67 67
68 // 设置数据点可见性 68 // 设置数据点可见性
69 LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); 69 LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
@@ -109,12 +109,12 @@ public class JFChartUtils { @@ -109,12 +109,12 @@ public class JFChartUtils {
109 NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); 109 NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis();
110 numberaxis.setUpperMargin(0.1);//设置最高的一个柱与图片顶端的距离(最高柱的10%) 110 numberaxis.setUpperMargin(0.1);//设置最高的一个柱与图片顶端的距离(最高柱的10%)
111 numberaxis.setLowerMargin(0.1); 111 numberaxis.setLowerMargin(0.1);
112 - numberaxis.setTickLabelFont(new Font("宋体", Font.BOLD, 16));  
113 - numberaxis.setLabelFont(new Font("宋体", Font.BOLD, 16)); 112 + numberaxis.setTickLabelFont(new Font("宋体", Font.BOLD, 20));
  113 + numberaxis.setLabelFont(new Font("宋体", Font.BOLD, 20));
114 114
115 //项目轴设置 115 //项目轴设置
116 CategoryAxis domainAxis = categoryplot.getDomainAxis(); 116 CategoryAxis domainAxis = categoryplot.getDomainAxis();
117 - domainAxis.setTickLabelFont(new Font("宋体", Font.BOLD, 16)); 117 + domainAxis.setTickLabelFont(new Font("宋体", Font.BOLD, 20));
118 118
119 } 119 }
120 120
@@ -125,9 +125,9 @@ public class JFChartUtils { @@ -125,9 +125,9 @@ public class JFChartUtils {
125 chart.setBackgroundPaint(Color.WHITE); 125 chart.setBackgroundPaint(Color.WHITE);
126 plot.setBackgroundPaint(Color.WHITE); 126 plot.setBackgroundPaint(Color.WHITE);
127 // 设置标签字体 127 // 设置标签字体
128 - plot.setLabelFont(new Font("宋体", Font.PLAIN, 16)); 128 + plot.setLabelFont(new Font("宋体", Font.PLAIN, 20));
129 // 设置无数据信息字体(如果需要) 129 // 设置无数据信息字体(如果需要)
130 - plot.setNoDataMessageFont(new Font("宋体", Font.PLAIN, 18)); 130 + plot.setNoDataMessageFont(new Font("宋体", Font.PLAIN, 20));
131 plot.setNoDataMessage("暂无数据"); 131 plot.setNoDataMessage("暂无数据");
132 plot.setShadowPaint(Color.WHITE); 132 plot.setShadowPaint(Color.WHITE);
133 plot.setLabelGenerator(new StandardPieSectionLabelGenerator( 133 plot.setLabelGenerator(new StandardPieSectionLabelGenerator(
@@ -160,9 +160,9 @@ public class JFChartUtils { @@ -160,9 +160,9 @@ public class JFChartUtils {
160 public static String createChart(List<PieChartVo> dataList, JFChartTypeEnum type, String title, String xAxisLabel, String yAxisLabel) throws IOException { 160 public static String createChart(List<PieChartVo> dataList, JFChartTypeEnum type, String title, String xAxisLabel, String yAxisLabel) throws IOException {
161 // 设置全局字体(支持中文) 161 // 设置全局字体(支持中文)
162 StandardChartTheme chartTheme = new StandardChartTheme("CN"); 162 StandardChartTheme chartTheme = new StandardChartTheme("CN");
163 - chartTheme.setExtraLargeFont(new Font("宋体", Font.PLAIN, 16)); // 标题字体  
164 - chartTheme.setLargeFont(new Font("宋体", Font.PLAIN, 16)); // 图例字体  
165 - chartTheme.setRegularFont(new Font("宋体", Font.PLAIN, 16)); // 轴标签字体 163 + chartTheme.setExtraLargeFont(new Font("宋体", Font.PLAIN, 20)); // 标题字体
  164 + chartTheme.setLargeFont(new Font("宋体", Font.PLAIN, 20)); // 图例字体
  165 + chartTheme.setRegularFont(new Font("宋体", Font.PLAIN, 20)); // 轴标签字体
166 ChartFactory.setChartTheme(chartTheme); 166 ChartFactory.setChartTheme(chartTheme);
167 JFreeChart chart = null; 167 JFreeChart chart = null;
168 switch (type) { 168 switch (type) {