设置图表的标签和值

Hal*_*alo 4 java jfreechart labels

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

tra*_*god 10

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

PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {1} {2}"));
Run Code Online (Sandbox Code Playgroud)

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