I'm creating pie charts using JFreeChart, and I want to set the value and the label seperately like in iReport, how can I do this?
In other words, I want the chart to show different results on the pie than in the legend.
I'm creating pie charts using JFreeChart, and I want to set the value and the label seperately like in iReport, how can I do this?
In other words, I want the chart to show different results on the pie than in the legend.
The MessageFormat
ArgumentIndex values correspond to the series name, domain and range. You can set a different generator for each series or for all series in the base.
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} {1} {2}"));
Addendum: For PiePlot
, the values have a slightly different meaning—series name, value and percentage.