我用JFreeChart框架生成饼状图,但想把数据信息在饼图上显示,是在饼图内部(即圆内)显示!怎样实现啊??

 去掉lable
pieplot.setLabelGenerator(null);
去掉线
pieplot.setLabelLinksVisible(false);
 
饼图标签显示百分比方法
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{2}"));

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


显示实际数值
PiePlot pp = (PiePlot)chart.getPlot();
pp.setLabelGenerator(new StandardPieSectionLabelGenerator("{1}"));

相关文章:

  • 2021-09-16
  • 2021-09-03
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-06-03
  • 2022-01-19
猜你喜欢
  • 2021-11-17
  • 2021-07-17
  • 2022-12-23
  • 2022-01-26
  • 2021-05-15
  • 2021-12-03
相关资源
相似解决方案