new*_*on2 12 java jfreechart font-size axis-labels
我的目标是增加"收入($)"和"年"的规模.但是我不知道怎么做.我能够增加"苹果,榴莲,橘子"和"2012年,2013年".
以下是我的代码.

JFreeChart chart = ChartFactory.createBarChart3D("", // chart title
"Years", // domain axis label
"Revenue ($)", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
false, // include legend
false, // tooltips
false);
CategoryPlot plot = chart.getCategoryPlot();
CategoryAxis axis = plot.getDomainAxis();
CategoryPlot p = chart.getCategoryPlot();
ValueAxis axis2 = p.getRangeAxis();
Font font = new Font("Dialog", Font.PLAIN, 25);
axis.setTickLabelFont(font);
Font font2 = new Font("Dialog", Font.PLAIN, 15);
axis2.setTickLabelFont(font2);
LegendTitle legend = new LegendTitle(plot.getRenderer());
Font font3 = new Font("Dialog", Font.PLAIN, 20);
legend.setItemFont(font3);
legend.setPosition(RectangleEdge.BOTTOM);
chart.addLegend(legend);
Run Code Online (Sandbox Code Playgroud)
Gra*_*amA 27
使用
CategoryPlot plot = chart.getCategoryPlot();
Font font3 = new Font("Dialog", Font.PLAIN, 25);
plot.getDomainAxis().setLabelFont(font3);
plot.getRangeAxis().setLabelFont(font3);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15913 次 |
| 最近记录: |