问题
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%)
Sample code:-
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));
}
Adding value to dataset.All data are inside arraylist.
Please help me.
回答1:
PieChartDemo2 is an example that uses a StandardPieSectionLabelGenerator for this. There's a related example here.
来源:https://stackoverflow.com/questions/12119780/how-to-set-pie-chart-values-in