Setting label and value of the chart

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—as shown here.

Leave a Comment