Setting label and value of the chart

前端 未结 1 1284
深忆病人
深忆病人 2020-11-30 15:06

I am creating pie charts using JFreeChart, and I want to set the value and the label seperately like in iReport. In other words, I want the chart t

相关标签:
1条回答
  • 2020-11-30 15:59

    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.

    0 讨论(0)
提交回复
热议问题