-1

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.

JDGuide
  • 6,239
  • 12
  • 46
  • 64

1 Answers1

1

PieChartDemo2 is an example that uses a StandardPieSectionLabelGenerator for this. There's a related example here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045