Java 如何以%设置饼图值

Java 如何以%设置饼图值,java,jfreechart,Java,Jfreechart,我正在使用JFreechart创建图表。创建饼图时,饼图的值以整数格式显示。但我需要这些值的百分比 My current Output :- Service manager (1) Service Executive (6) Service co-coordinator (3) My Expected output :- Service manager (10%) Service Executive (60%) Service co-coordinator (30%) 示例代码:-

我正在使用JFreechart创建图表。创建饼图时,饼图的值以整数格式显示。但我需要这些值的百分比

My current Output :- 

Service manager (1)
Service Executive (6)
Service co-coordinator (3)

My Expected output :-


Service manager (10%)
Service Executive (60%)
Service co-coordinator (30%)
示例代码:-

for(int i=0;i<dataset_bydeglist.size();i+=2){
                        dataset.setValue(dataset_bydeglist.get(i).toString()+" ("+(Integer)dataset_bydeglist.get(i+1)+") ",(Integer)dataset_bydeglist.get(i+1));
                    }

用于(int i=0;i是一个使用a的函数。有一个相关的例子。

我的问题是什么?你的问题不是很清楚。是关于设置值还是关于输出?与该问题相关的其余代码在哪里?输出取决于你输入的值。如果没有一些有效值,如何输出是可能的。