简单的demo 生成一个圆饼图
public class JFreeChart {
public static void main(String[] args) throws IOException {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("字段1", 2500);
dataset.setValue("字段2", 1000);
dataset.setValue("字段3", 2000);
dataset.setValue("字段4", 1500);
dataset.setValue("字段5", 3000);
JFreeChart chart = ChartFactory.createPieChart3D("呵呵呵呵", dataset);
chart.getTitle().setFont(new Font("华文彩云", Font.ITALIC, 80));
chart.getLegend().setItemFont(new Font("华文新魏", Font.BOLD, 50));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelFont(new Font("宋体", Font.PLAIN, 30));
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0},{1}/{3},{2}"));
plot.setForegroundAlpha(0.6f);
ChartUtilities.saveChartAsJPEG(new File("aaa.jpg"), chart, 1000, 600);
}
}