如何在jfreechart 柱圖柱子上顯示對應數值

       
/**

**QQ:252574345

**MSN:[email protected]

*/

  CategoryPlot categoryplot = (CategoryPlot)chart.getPlot();

 

 StackedBarRenderer3D stackedbarrenderer = (StackedBarRenderer3D)categoryplot.getRenderer();

 

stackedbarrenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator()  );

 

當然,和前面的介紹一樣,也可以對顯示的數值進行格式化,例如

 

//new StandardCategoryItemLabelGenerator("{2}",new DecimalFormat("0.0%"))

 

可以在柱子上顯示名稱,數值,比例等信息

發佈了1 篇原創文章 · 獲贊 0 · 訪問量 7701
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章