如何以百分比设置饼图值

问题描述:

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

I am using JFreechart for creating chart. When i am creating pie chart the values for the pie chart are displaying with integer format.But i need those values in Percentage.

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));
                    }

为数据集添加值.所有数据都在arraylist内.

Adding value to dataset.All data are inside arraylist.

请帮助我.