您的位置:首页 > 其它

JFreeChart饼状图显示数字

2013-04-03 00:00 155 查看
饼图标签显示百分比方法

PiePlot pp = (PiePlot)chart.getPlot();

pp.setLabelGenerator(new StandardPieSectionLabelG
enerator("{2}"));

如果百分比要包括一位小数,则使用

pp.setLabelGenerator(new StandardPieSectionLabelG
enerator("{2}",new DecimalFormat("0.0"),new DecimalFormat("0.0%")));

显示实际数值

PiePlot pp = (PiePlot)chart.getPlot();

pp.setLabelGenerator(new StandardPieSectionLabelG
enerator("{1}"));
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  JFreeChart 饼图