`

jfreechart设置饼图百分比

阅读更多
PiePlot3D     plot=(PiePlot3D)chart.getPlot();        
  //   图片中显示百分比:默认方式        
  plot.setLabelGenerator(new   StandardPieSectionLabelGenerator(StandardPieToolTipGenerator.DEFAULT_TOOLTIP_FORMAT));        
  //   图片中显示百分比:自定义方式,{0}   表示选项,   {1}   表示数值,   {2}   表示所占比例   ,小数点后两位        
  plot.setLabelGenerator(new   StandardPieSectionLabelGenerator( "{0}={1}({2}) ",   NumberFormat.getNumberInstance(),   new   DecimalFormat( "0.00% ")));          
  //   图例显示百分比:自定义方式,   {0}   表示选项,   {1}   表示数值,   {2}   表示所占比例      
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics