Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set different values for Legend and Labels in piechart While I am using Chart Engine in android

Hi I am using A chart Engine to display pie chart in android.In my code I want to show values on labels and area corresponding to that vale on legend.But I am unable to get that one.Please can any one helps to me.Thanks in advance.

I want like below

like image 528
hcp Avatar asked Dec 13 '25 10:12

hcp


2 Answers

Displaying the pie labels with separate values from the legend labels is not possible in AChartEngine.

However, you can display the pie slice value (age in your case) in the middle of each slice, using:

renderer.setDisplayChartValues(true);

There was a bug in the code that was preventing displaying the chart values when the labels were not displaying. I have just fixed this issue in SVN. You can checkout the code according to this page and run an ant dist in order to build an up to date achartengine.jar file including this fix.

like image 137
Dan D. Avatar answered Dec 14 '25 23:12

Dan D.


I was also having the same problem but now its solved. Thanks dan...

You can use

renderer.setDisplayValues(true);

This displays the %of distribution in the pie chart itself.

like image 35
Sivaguru Jambulingam Avatar answered Dec 14 '25 22:12

Sivaguru Jambulingam