JFreeChart饼状图显示数字

      饼图标签显示百分比方法
   PiePlot pp = (PiePlot)chart.getPlot();
   pp.setLabelGenerator(new StandardPieSectionLabelG enerator("{2}"));

   若是百分比要包括一位小数,则使用
   pp.setLabelGenerator(new StandardPieSectionLabelG enerator("{2}",new DecimalFormat("0.0"),new DecimalFormat("0.0%")));

   显示实际数值
   PiePlot pp = (PiePlot)chart.getPlot();
   pp.setLabelGenerator(new StandardPieSectionLabelG enerator("{1}"));
相关文章
相关标签/搜索