//创建圆饼图
JFreeChartchart=ChartFactory.createPieChart3D(title,data,true,false,false);
PiePlotplot=(PiePlot)chart.getPlot();
plot.setLabelGenerator(null);//取消图中标签
plot.setIgnoreZeroValues(true);//消除数据值为0的项
//图例显示百分比:自定义方式,{0}表示选项,{1}表示数值,{2}表示所占比例
plot.setLegendLabelGenerator(newStandardPieSectionLabelGenerator("{0}={1}({2})",NumberFormat.getNumberInstance(),newDecimalFormat("0.00%")));
JFreeChart饼图取消图中标签
最新推荐文章于 2024-09-15 09:10:56 发布