早教吧 育儿知识 作业答案 考试题库 百科 知识分享

jfreechart下列方法过期了用什么替代renderer.setItemLabelGenerator(newStandardCategoryItemLabelGenerator());renderer.setItemLabelFont(newFont("",Font.BOLD,12));renderer.setItemLabelPaint(Color.black);renderer.setItemLabelsVisible(true);

题目详情
jfreechart 下列方法过期了 用什么替代
renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setItemLabelFont(new Font("",Font.BOLD,12));
renderer.setItemLabelPaint(Color.black);
renderer.setItemLabelsVisible(true);
▼优质解答
答案和解析
试试:
JFreeChart chart = ChartFactory.createPieChart3D(
chartPieEntity.getTitle(),
chartPieEntity.getDataset(),
true,
true,
false
);
chart.getTitle().setFont(new Font("宋体", Font.BOLD, 20));
PiePlot piePlot = (PiePlot) chart.getPlot();
piePlot.setLabelFont(new Font("宋体", Font.BOLD, 12));
//设置Pie的边框是否可见
piePlot.setSectionOutlinesVisible(true);
// 指定图片的透明度(0.0-1.0)
piePlot.setForegroundAlpha(1.0f);
//设置边框的颜色
piePlot.setBaseSectionOutlinePaint(Color.black);
//设置边框的粗细,new BasicStroke(2.0f)
piePlot.setBaseSectionOutlineStroke(new BasicStroke(1));
//设置空值,0值,负值是否显示出来,如果显示的话就是false
piePlot.setIgnoreNullValues(true);
piePlot.setIgnoreZeroValues(true);
piePlot.setNoDataMessage("无数据显示");
//设置字体
chart.getLegend().setItemFont(new Font("宋体", Font.BOLD, 12));