设置图表的标签和值

我正在使用JFreeChart创建饼图,我想在iReport单独设置值和标签。 换句话说,我希望图表在饼图上显示的结果与图例中的结果不同。 有什么方法可以实现这个目标吗?

MessageFormat ArgumentIndex值对应于系列名称范围 。 您可以为每个系列或基础中的所有系列设置不同的生成器。

 PiePlot plot = (PiePlot) chart.getPlot(); plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {1} {2}")); 

附录:对于PiePlot ,值的PiePlot略有不同 – 系列名称百分比