最近的报表项目需要在饼图的标签上添加百分比,在网上找到一个例子,添加百分比的方法如下:
//显示百分比
plot.setLabelGenerator(new StandardPieItemLabelGenerator(StandardPieItemLabelGenerator.DEFAULT_TOOLTIP_FORMAT));
plot.setLegendLabelGenerator(new StandardPieItemLabelGenerator("{0}: ({1}M, {2})"));
结果Eclipse提示

本文档介绍如何在JFreechart 1.0.3版本的3D饼图中显示百分比。由于在尝试使用StandardPieItemLabelGenerator时遇到未声明类型的错误,通过查阅API文档,找到了适用于当前版本的方法。

1080

被折叠的 条评论
为什么被折叠?



