ITeye博客

jfreechart杂记

letitbe · 2008-09-04 10:59 · jfreechart(cewolf) · Markdown

1,饼图如何显示百分比
jfreechart-1.0.1中设置饼图默认的Label是传入的数值,但往往我们想显示的是Label的百分比,如何设置值为“n%”呢?在旧包里 是可以直接设置的,而jfreechart-1.0.1包把设置放到了StandardPieSectionLabelGenerator.java的构 造方法里面了
pieplot.setLabelGenerator(new org.jfree.chart.labels.StandardPieSectionLabelGenerator(
                    ("{0}: ({2})"), java.text.NumberFormat
                            .getNumberInstance(),
                    new java.text.DecimalFormat("0.00%")));
来源:http://hi.baidu.com/java137/blog/item/166d4f433fcb35119313c6eb.html

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。