Showing
1 changed file
with
10 additions
and
10 deletions
... | ... | @@ -62,8 +62,8 @@ public class JFChartUtils { |
62 | 62 | NumberAxis numberaxis = (NumberAxis) plot.getRangeAxis(); |
63 | 63 | numberaxis.setUpperMargin(0.1); |
64 | 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 | 69 | LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer(); |
... | ... | @@ -109,12 +109,12 @@ public class JFChartUtils { |
109 | 109 | NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); |
110 | 110 | numberaxis.setUpperMargin(0.1);//设置最高的一个柱与图片顶端的距离(最高柱的10%) |
111 | 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 | 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 | 125 | chart.setBackgroundPaint(Color.WHITE); |
126 | 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 | 131 | plot.setNoDataMessage("暂无数据"); |
132 | 132 | plot.setShadowPaint(Color.WHITE); |
133 | 133 | plot.setLabelGenerator(new StandardPieSectionLabelGenerator( |
... | ... | @@ -160,9 +160,9 @@ public class JFChartUtils { |
160 | 160 | public static String createChart(List<PieChartVo> dataList, JFChartTypeEnum type, String title, String xAxisLabel, String yAxisLabel) throws IOException { |
161 | 161 | // 设置全局字体(支持中文) |
162 | 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 | 166 | ChartFactory.setChartTheme(chartTheme); |
167 | 167 | JFreeChart chart = null; |
168 | 168 | switch (type) { | ... | ... |