關(guān)鍵字: jfreechart 餅圖 標簽
/** **QQ:252574345 **MSN:lele_love_lomboz@hotmail.com */
形成餅圖數(shù)據(jù)集合的時候,往往是這樣的 private DefaultPieDataset dataset; for(){ dataset.setValue ( names[i],values[i]); } 在設(shè)置圖例的時候,使用如下方法設(shè)置它的顯示內(nèi)容 //chart 為JFreeChart 對象 PiePlot pieplot = (PiePlot)chart.getPlot(); pieplot.setLegendLabelGenerator(new StandardPieItemLabelGenerator("{數(shù)值}")) //數(shù)值為0代表 圖例中顯示names[i]的值 //數(shù)值為1代表 圖例中顯示values[i]的值 //數(shù)值為2代表 圖例中顯示計算后自動得到的各個塊的百分比 |
|
來自: WindySky > 《JFREECHART》